Single ribbit namespace instead of window globals
Use esbuild --global-name=ribbit to expose a single namespace.
This commit is contained in:
+9
-13
@@ -102,16 +102,12 @@ export class RibbitEditor extends Ribbit {
|
||||
}
|
||||
}
|
||||
|
||||
// Attach public API to window for <script> tag usage.
|
||||
(window as any).HopDown = HopDown;
|
||||
(window as any).inlineTag = inlineTag;
|
||||
(window as any).defaultTags = defaultTags;
|
||||
(window as any).defaultBlockTags = defaultBlockTags;
|
||||
(window as any).defaultInlineTags = defaultInlineTags;
|
||||
(window as any).defaultTheme = defaultTheme;
|
||||
(window as any).Ribbit = Ribbit;
|
||||
(window as any).RibbitEditor = RibbitEditor;
|
||||
(window as any).RibbitPlugin = RibbitPlugin;
|
||||
(window as any).camelCase = camelCase;
|
||||
(window as any).decodeHtmlEntities = decodeHtmlEntities;
|
||||
(window as any).encodeHtmlEntities = encodeHtmlEntities;
|
||||
// Public API — accessed as ribbit.Editor, ribbit.HopDown, etc.
|
||||
export { RibbitEditor as Editor };
|
||||
export { Ribbit as Viewer };
|
||||
export { RibbitPlugin as Plugin };
|
||||
export { HopDown };
|
||||
export { inlineTag };
|
||||
export { defaultTags, defaultBlockTags, defaultInlineTags };
|
||||
export { defaultTheme };
|
||||
export { camelCase, decodeHtmlEntities, encodeHtmlEntities };
|
||||
|
||||
Reference in New Issue
Block a user