notations 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +3 -2
- package/dist/notations.umd.js +127 -88
- package/dist/notations.umd.min.js +6 -13
- package/dist/notations.umd.min.js.map +1 -1
- package/lib/cjs/beats.d.ts +2 -0
- package/lib/cjs/beats.js +38 -20
- package/lib/cjs/beats.js.map +1 -1
- package/lib/cjs/beatview.d.ts +2 -2
- package/lib/cjs/beatview.js +3 -1
- package/lib/cjs/beatview.js.map +1 -1
- package/lib/cjs/carnatic/atomviews.js +18 -1
- package/lib/cjs/carnatic/atomviews.js.map +1 -1
- package/lib/cjs/carnatic/beatviews.d.ts +1 -1
- package/lib/cjs/carnatic/beatviews.js +4 -1
- package/lib/cjs/carnatic/beatviews.js.map +1 -1
- package/lib/cjs/core.d.ts +13 -7
- package/lib/cjs/core.js +28 -13
- package/lib/cjs/core.js.map +1 -1
- package/lib/cjs/entity.d.ts +12 -0
- package/lib/cjs/entity.js +18 -0
- package/lib/cjs/entity.js.map +1 -1
- package/lib/cjs/iterators.js +7 -5
- package/lib/cjs/iterators.js.map +1 -1
- package/lib/cjs/notation.d.ts +8 -9
- package/lib/cjs/notation.js +2 -11
- package/lib/cjs/notation.js.map +1 -1
- package/lib/cjs/parser.d.ts +2 -3
- package/lib/cjs/parser.js +10 -37
- package/lib/cjs/parser.js.map +1 -1
- package/lib/cjs/shapes.js +2 -0
- package/lib/cjs/shapes.js.map +1 -1
- package/lib/cjs/web/components/DockViewPlayground.js +8 -6
- package/lib/cjs/web/components/DockViewPlayground.js.map +1 -1
- package/lib/esm/beats.d.ts +2 -0
- package/lib/esm/beats.js +38 -20
- package/lib/esm/beats.js.map +1 -1
- package/lib/esm/beatview.d.ts +2 -2
- package/lib/esm/beatview.js +3 -1
- package/lib/esm/beatview.js.map +1 -1
- package/lib/esm/carnatic/atomviews.js +18 -1
- package/lib/esm/carnatic/atomviews.js.map +1 -1
- package/lib/esm/carnatic/beatviews.d.ts +1 -1
- package/lib/esm/carnatic/beatviews.js +4 -1
- package/lib/esm/carnatic/beatviews.js.map +1 -1
- package/lib/esm/core.d.ts +13 -7
- package/lib/esm/core.js +29 -14
- package/lib/esm/core.js.map +1 -1
- package/lib/esm/entity.d.ts +12 -0
- package/lib/esm/entity.js +17 -0
- package/lib/esm/entity.js.map +1 -1
- package/lib/esm/iterators.js +7 -5
- package/lib/esm/iterators.js.map +1 -1
- package/lib/esm/notation.d.ts +8 -9
- package/lib/esm/notation.js +3 -12
- package/lib/esm/notation.js.map +1 -1
- package/lib/esm/parser.d.ts +2 -3
- package/lib/esm/parser.js +10 -37
- package/lib/esm/parser.js.map +1 -1
- package/lib/esm/shapes.js +3 -1
- package/lib/esm/shapes.js.map +1 -1
- package/lib/esm/web/components/DockViewPlayground.js +9 -7
- package/lib/esm/web/components/DockViewPlayground.js.map +1 -1
- package/package.json +1 -1
|
@@ -114,19 +114,18 @@ class DockViewPlayground {
|
|
|
114
114
|
}
|
|
115
115
|
this.container.style.width = this.container.style.width || "100%";
|
|
116
116
|
const isDark = this.isDarkMode();
|
|
117
|
-
this.container
|
|
117
|
+
const dockviewComponent = new dockview_core_1.DockviewComponent(this.container, {
|
|
118
|
+
createComponent: (options) => this.createComponent(options),
|
|
119
|
+
theme: isDark ? dockview_core_1.themeDark : dockview_core_1.themeLight,
|
|
120
|
+
});
|
|
118
121
|
const observer = new MutationObserver(() => {
|
|
119
122
|
const dark = this.isDarkMode();
|
|
120
|
-
|
|
121
|
-
this.container.classList.add(dark ? "dockview-theme-dark" : "dockview-theme-light");
|
|
123
|
+
dockviewComponent.updateOptions({ theme: dark ? dockview_core_1.themeDark : dockview_core_1.themeLight });
|
|
122
124
|
});
|
|
123
125
|
observer.observe(document.documentElement, {
|
|
124
126
|
attributes: true,
|
|
125
127
|
attributeFilter: ["class"],
|
|
126
128
|
});
|
|
127
|
-
const dockviewComponent = new dockview_core_1.DockviewComponent(this.container, {
|
|
128
|
-
createComponent: (options) => this.createComponent(options),
|
|
129
|
-
});
|
|
130
129
|
this.dockview = dockviewComponent.api;
|
|
131
130
|
if (!this.config.persistLayout || !this.loadLayout()) {
|
|
132
131
|
this.createDefaultLayout();
|
|
@@ -136,6 +135,9 @@ class DockViewPlayground {
|
|
|
136
135
|
this.saveLayout();
|
|
137
136
|
});
|
|
138
137
|
}
|
|
138
|
+
requestAnimationFrame(() => {
|
|
139
|
+
this.render();
|
|
140
|
+
});
|
|
139
141
|
this.log("Playground initialized", "info");
|
|
140
142
|
}
|
|
141
143
|
isDarkMode() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DockViewPlayground.js","sourceRoot":"","sources":["../../../../src/web/components/DockViewPlayground.ts"],"names":[],"mappings":";;;;;AAaA,iDAA6F;AAC7F,0EAA8E;AAoF9E,MAAM,cAAc,GAA6B;IAC/C,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,UAAU,EAAE,6BAA6B;IACzC,aAAa,EAAE,CAAC;IAChB,UAAU,EAAE,IAAI;CACjB,CAAC;AA4BF,MAAqB,kBAAkB;IAyBrC,YAAY,SAAsB,EAAE,SAAmC,EAAE;;QAjBjE,aAAQ,GAAuB,IAAI,CAAC;QAGpC,qBAAgB,GAA4B,IAAI,CAAC;QAGjD,kBAAa,GAAuB,IAAI,CAAC;QAGzC,mBAAc,GAAmB,EAAE,CAAC;QAS1C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,mCAAQ,cAAc,GAAK,MAAM,CAAE,CAAC;QAC/C,IAAI,CAAC,eAAe,GAAG,MAAA,IAAI,CAAC,MAAM,CAAC,WAAW,mCAAI,IAAI,CAAC;QAEvD,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAKD,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAKD,IAAI,MAAM;;QAC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C,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC;QAC/B,CAAC;QAED,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAClD,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;QAEhD,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,aAAa,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC;IACjE,CAAC;CACF;AAlgBD,qCAkgBC","sourcesContent":["/**\n * DockViewPlayground - A complete notation playground with DockView layout.\n *\n * Provides a ready-to-use playground experience with:\n * - Resizable editor panel\n * - Resizable notation output panel\n * - Optional console panel for logs/errors\n * - Layout persistence to localStorage\n * - Dark mode support\n *\n * Uses SideBySideEditor internally for editor/output management.\n */\n\nimport { DockviewComponent, DockviewApi, IContentRenderer, Parameters } from \"dockview-core\";\nimport SideBySideEditor, { SideBySideEditorConfig } from \"./SideBySideEditor\";\nimport { Notation } from \"../../notation\";\nimport { GlobalBeatLayout } from \"../../beats\";\n\n/**\n * Configuration for DockViewPlayground.\n */\nexport interface DockViewPlaygroundConfig {\n /**\n * Initial source text.\n */\n initialSource?: string;\n\n /**\n * Whether to show the console panel initially.\n * @default true\n */\n showConsole?: boolean;\n\n /**\n * Whether to persist layout to localStorage.\n * @default true\n */\n persistLayout?: boolean;\n\n /**\n * Storage key for layout persistence.\n * @default \"notations-playground-layout\"\n */\n storageKey?: string;\n\n /**\n * Layout version number. Increment to force layout reset when structure changes.\n * @default 1\n */\n layoutVersion?: number;\n\n /**\n * Whether to enable scroll synchronization between editor and output.\n * @default true\n */\n syncScroll?: boolean;\n\n /**\n * Optional markdown parser for RawBlock content.\n */\n markdownParser?: (content: string) => string;\n\n /**\n * SideBySideEditor configuration options.\n */\n editorConfig?: Partial<SideBySideEditorConfig>;\n\n /**\n * Callback when source changes.\n */\n onSourceChange?: (source: string) => void;\n\n /**\n * Callback when notation is successfully parsed.\n */\n onNotationParsed?: (notation: Notation, beatLayout: GlobalBeatLayout) => void;\n\n /**\n * Callback when parsing fails.\n */\n onParseError?: (errors: any[]) => void;\n\n /**\n * Function to detect dark mode. If not provided, checks for \"dark\" class on documentElement.\n */\n isDarkMode?: () => boolean;\n\n /**\n * CSS class for the editor textarea.\n */\n editorClass?: string;\n\n /**\n * CSS class for the output container.\n */\n outputClass?: string;\n}\n\nconst DEFAULT_CONFIG: DockViewPlaygroundConfig = {\n showConsole: true,\n persistLayout: true,\n storageKey: \"notations-playground-layout\",\n layoutVersion: 1,\n syncScroll: true,\n};\n\n/**\n * Console log entry.\n */\ninterface ConsoleEntry {\n timestamp: Date;\n level: \"info\" | \"error\" | \"warning\";\n message: string;\n}\n\n/**\n * DockViewPlayground creates a complete notation playground with DockView layout.\n *\n * Usage:\n * ```typescript\n * const playground = new DockViewPlayground(container, {\n * initialSource: \"s r g m p\",\n * onSourceChange: (source) => console.log(\"Source:\", source),\n * });\n *\n * // Access the SideBySideEditor\n * playground.editor.source = \"new source\";\n *\n * // Log to console panel\n * playground.log(\"Hello!\", \"info\");\n * ```\n */\nexport default class DockViewPlayground {\n /** The container element */\n readonly container: HTMLElement;\n\n /** Configuration */\n readonly config: DockViewPlaygroundConfig;\n\n /** DockView API */\n private dockview: DockviewApi | null = null;\n\n /** SideBySideEditor instance */\n private sideBySideEditor: SideBySideEditor | null = null;\n\n /** Console output element */\n private consoleOutput: HTMLElement | null = null;\n\n /** Console entries */\n private consoleEntries: ConsoleEntry[] = [];\n\n /**\n * Creates a new DockViewPlayground.\n *\n * @param container The container element for the playground\n * @param config Configuration options\n */\n constructor(container: HTMLElement, config: DockViewPlaygroundConfig = {}) {\n this.container = container;\n this.config = { ...DEFAULT_CONFIG, ...config };\n this._consoleVisible = this.config.showConsole ?? true;\n\n this.init();\n }\n\n /**\n * Gets the SideBySideEditor instance.\n */\n get editor(): SideBySideEditor | null {\n return this.sideBySideEditor;\n }\n\n /**\n * Gets the current source.\n */\n get source(): string {\n return this.sideBySideEditor?.source || \"\";\n }\n\n /**\n * Sets the source and re-renders.\n */\n set source(value: string) {\n if (this.sideBySideEditor) {\n this.sideBySideEditor.source = value;\n }\n }\n\n /**\n * Logs a message to the console panel.\n */\n log(message: string, level: \"info\" | \"error\" | \"warning\" = \"info\"): void {\n const entry: ConsoleEntry = {\n timestamp: new Date(),\n level,\n message,\n };\n this.consoleEntries.push(entry);\n this.renderConsoleEntry(entry);\n }\n\n /**\n * Clears the console.\n */\n clearConsole(): void {\n this.consoleEntries = [];\n if (this.consoleOutput) {\n this.consoleOutput.innerHTML = \"\";\n }\n }\n\n /**\n * Renders the notation manually.\n */\n render(): boolean {\n return this.sideBySideEditor?.render() || false;\n }\n\n /**\n * Destroys the playground and cleans up resources.\n */\n destroy(): void {\n this.sideBySideEditor?.destroy();\n this.dockview?.dispose();\n this.container.innerHTML = \"\";\n }\n\n /**\n * Resets the layout to defaults.\n * Clears persisted layout and recreates the default layout.\n */\n resetLayout(): void {\n if (this.config.storageKey) {\n localStorage.removeItem(this.config.storageKey);\n }\n if (this.dockview) {\n this.dockview.clear();\n this.createDefaultLayout();\n }\n }\n\n // Console visibility API\n\n /** Whether the console is currently visible */\n private _consoleVisible: boolean;\n\n /**\n * Returns whether the console panel is currently visible.\n */\n isConsoleVisible(): boolean {\n return this._consoleVisible;\n }\n\n /**\n * Shows the console panel.\n */\n showConsole(): void {\n if (this._consoleVisible || !this.dockview) return;\n\n // Add console below editor (spans full width at bottom)\n this.dockview.addPanel({\n id: \"console\",\n component: \"console\",\n title: \"Console\",\n position: { direction: \"below\", referencePanel: \"editor\" },\n });\n\n // Set console to ~10% height\n const consolePanel = this.dockview.getPanel(\"console\");\n const containerHeight = this.container.clientHeight || 600;\n if (consolePanel?.group?.api) {\n consolePanel.group.api.setSize({ height: Math.floor(containerHeight * 0.1) });\n }\n\n this._consoleVisible = true;\n }\n\n /**\n * Hides the console panel.\n */\n hideConsole(): void {\n if (!this._consoleVisible || !this.dockview) return;\n\n const consolePanel = this.dockview.getPanel(\"console\");\n if (consolePanel) {\n consolePanel.api.close();\n }\n this._consoleVisible = false;\n }\n\n /**\n * Toggles the console panel visibility.\n * @returns The new visibility state.\n */\n toggleConsole(): boolean {\n if (this._consoleVisible) {\n this.hideConsole();\n } else {\n this.showConsole();\n }\n return this._consoleVisible;\n }\n\n /**\n * Initializes the playground.\n */\n private init(): void {\n // Ensure container has proper sizing for DockView\n // DockView requires explicit height on its container\n if (!this.container.style.height && !this.container.offsetHeight) {\n this.container.style.height = \"100%\";\n }\n this.container.style.width = this.container.style.width || \"100%\";\n\n // Apply theme class (preserve existing classes)\n const isDark = this.isDarkMode();\n this.container.classList.add(isDark ? \"dockview-theme-dark\" : \"dockview-theme-light\");\n\n // Watch for theme changes\n const observer = new MutationObserver(() => {\n const dark = this.isDarkMode();\n this.container.classList.remove(\"dockview-theme-dark\", \"dockview-theme-light\");\n this.container.classList.add(dark ? \"dockview-theme-dark\" : \"dockview-theme-light\");\n });\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"class\"],\n });\n\n // Create DockView\n const dockviewComponent = new DockviewComponent(this.container, {\n createComponent: (options) => this.createComponent(options),\n });\n\n this.dockview = dockviewComponent.api;\n\n // Try to restore saved layout, otherwise create default\n if (!this.config.persistLayout || !this.loadLayout()) {\n this.createDefaultLayout();\n }\n\n // Listen for layout changes to persist them\n if (this.config.persistLayout) {\n this.dockview.onDidLayoutChange(() => {\n this.saveLayout();\n });\n }\n\n this.log(\"Playground initialized\", \"info\");\n }\n\n /**\n * Checks if dark mode is active.\n */\n private isDarkMode(): boolean {\n if (this.config.isDarkMode) {\n return this.config.isDarkMode();\n }\n return document.documentElement.classList.contains(\"dark\");\n }\n\n /**\n * Saves the layout to localStorage.\n */\n private saveLayout(): void {\n if (!this.dockview || !this.config.storageKey) return;\n try {\n const layout = this.dockview.toJSON();\n const data = {\n version: this.config.layoutVersion,\n layout,\n };\n localStorage.setItem(this.config.storageKey, JSON.stringify(data));\n } catch (e) {\n console.warn(\"Failed to save layout:\", e);\n }\n }\n\n /**\n * Loads the layout from localStorage.\n */\n private loadLayout(): boolean {\n if (!this.dockview || !this.config.storageKey) return false;\n try {\n const saved = localStorage.getItem(this.config.storageKey);\n if (saved) {\n const data = JSON.parse(saved);\n // Check version - if outdated or missing, reset to defaults\n if (data.version !== this.config.layoutVersion) {\n localStorage.removeItem(this.config.storageKey);\n return false;\n }\n this.dockview.fromJSON(data.layout);\n return true;\n }\n } catch (e) {\n console.warn(\"Failed to load layout:\", e);\n if (this.config.storageKey) {\n localStorage.removeItem(this.config.storageKey);\n }\n }\n return false;\n }\n\n /**\n * Creates a component for DockView.\n */\n private createComponent(options: any): IContentRenderer {\n switch (options.name) {\n case \"editor\":\n return this.createEditorPanel();\n case \"output\":\n return this.createOutputPanel();\n case \"console\":\n return this.createConsolePanel();\n default:\n return {\n element: document.createElement(\"div\"),\n init: () => {},\n };\n }\n }\n\n /**\n * Creates the default layout.\n * Layout: Editor and Output side by side on top (80% height),\n * Console spanning full width on bottom (20% height).\n */\n private createDefaultLayout(): void {\n if (!this.dockview) return;\n\n // Get container dimensions for proportional sizing\n const containerHeight = this.container.clientHeight || 600;\n const containerWidth = this.container.clientWidth || 800;\n\n // Editor panel (top left)\n this.dockview.addPanel({\n id: \"editor\",\n component: \"editor\",\n title: \"Editor\",\n });\n\n // Console panel (bottom, full width) - add BEFORE output\n // so it creates a vertical split at the root level\n if (this._consoleVisible) {\n this.dockview.addPanel({\n id: \"console\",\n component: \"console\",\n title: \"Console\",\n position: { direction: \"below\", referencePanel: \"editor\" },\n });\n }\n\n // Output panel (top right) - splits the top row\n this.dockview.addPanel({\n id: \"output\",\n component: \"output\",\n title: \"Notation Output\",\n position: { direction: \"right\", referencePanel: \"editor\" },\n });\n\n // Set sizes using the group API\n const editorPanel = this.dockview.getPanel(\"editor\");\n const consolePanel = this.dockview.getPanel(\"console\");\n const outputPanel = this.dockview.getPanel(\"output\");\n\n // Set console height to ~10% of container\n if (consolePanel?.group?.api) {\n consolePanel.group.api.setSize({ height: Math.floor(containerHeight * 0.1) });\n }\n\n // Set editor and output to 50% width each\n if (editorPanel?.group?.api) {\n editorPanel.group.api.setSize({ width: Math.floor(containerWidth * 0.5) });\n }\n if (outputPanel?.group?.api) {\n outputPanel.group.api.setSize({ width: Math.floor(containerWidth * 0.5) });\n }\n }\n\n /**\n * Creates the editor panel.\n */\n private createEditorPanel(): IContentRenderer {\n const element = document.createElement(\"div\");\n element.className = \"dvp-panel dvp-editor-panel\";\n element.style.cssText = \"display: flex; flex-direction: column; height: 100%; padding: 0.5rem;\";\n\n return {\n element,\n init: (_params: Parameters) => {\n // Create SideBySideEditor config\n const editorConfig: SideBySideEditorConfig = {\n initialSource: this.config.initialSource,\n debounceDelay: 300,\n syncScroll: this.config.syncScroll,\n markdownParser: this.config.markdownParser,\n ...this.config.editorConfig,\n onSourceChange: (source) => {\n this.log(`Source changed (${source.length} chars)`, \"info\");\n this.config.onSourceChange?.(source);\n this.config.editorConfig?.onSourceChange?.(source);\n },\n onNotationParsed: (notation, beatLayout) => {\n const lineCount = beatLayout.gridModelsForLine.size;\n this.log(`Parsed: ${lineCount} line${lineCount !== 1 ? \"s\" : \"\"}`, \"info\");\n this.config.onNotationParsed?.(notation, beatLayout);\n this.config.editorConfig?.onNotationParsed?.(notation, beatLayout);\n },\n onParseError: (errors) => {\n errors.forEach((e) => {\n this.log(`Parse error: ${e.message || e}`, \"error\");\n });\n this.config.onParseError?.(errors);\n this.config.editorConfig?.onParseError?.(errors);\n },\n editorClass: this.config.editorClass,\n };\n\n // Create the editor\n this.sideBySideEditor = new SideBySideEditor(editorConfig);\n\n // Style the editor element\n const editorEl = this.sideBySideEditor.editorElement;\n editorEl.style.cssText = `\n width: 100%;\n height: 100%;\n resize: none;\n font-family: \"SF Mono\", \"Monaco\", \"Inconsolata\", \"Fira Code\", monospace;\n font-size: 14px;\n padding: 0.5rem;\n border: 1px solid var(--dv-separator-border, #ddd);\n border-radius: 4px;\n outline: none;\n `;\n\n element.appendChild(editorEl);\n },\n };\n }\n\n /**\n * Creates the output panel.\n */\n private createOutputPanel(): IContentRenderer {\n const element = document.createElement(\"div\");\n element.className = \"dvp-panel dvp-output-panel\";\n element.style.cssText = \"display: flex; flex-direction: column; height: 100%;\";\n\n return {\n element,\n init: (_params: Parameters) => {\n if (this.sideBySideEditor) {\n // Style the output element\n const outputEl = this.sideBySideEditor.outputElement;\n outputEl.style.cssText = `\n width: 100%;\n height: 100%;\n overflow: auto;\n padding: 1rem;\n `;\n\n element.appendChild(outputEl);\n }\n },\n };\n }\n\n /**\n * Creates the console panel.\n */\n private createConsolePanel(): IContentRenderer {\n const element = document.createElement(\"div\");\n element.className = \"dvp-panel dvp-console-panel\";\n element.style.cssText = \"display: flex; flex-direction: column; height: 100%;\";\n\n return {\n element,\n init: (_params: Parameters) => {\n // Console header\n const header = document.createElement(\"div\");\n header.className = \"dvp-console-header\";\n header.style.cssText = `\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.25rem 0.5rem;\n font-size: 0.75rem;\n `;\n\n const clearBtn = document.createElement(\"button\");\n clearBtn.className = \"dvp-console-clear-btn\";\n clearBtn.textContent = \"Clear\";\n clearBtn.style.cssText = `\n padding: 0.125rem 0.5rem;\n font-size: 0.75rem;\n border-radius: 3px;\n cursor: pointer;\n `;\n clearBtn.onclick = () => this.clearConsole();\n header.appendChild(clearBtn);\n\n element.appendChild(header);\n\n // Console output\n this.consoleOutput = document.createElement(\"div\");\n this.consoleOutput.className = \"dvp-console-output\";\n this.consoleOutput.style.cssText = `\n flex: 1;\n overflow: auto;\n padding: 0.5rem;\n font-family: \"SF Mono\", \"Monaco\", \"Inconsolata\", monospace;\n font-size: 0.75rem;\n `;\n element.appendChild(this.consoleOutput);\n\n // Re-render existing entries\n this.consoleEntries.forEach((entry) => this.renderConsoleEntry(entry));\n },\n };\n }\n\n /**\n * Renders a console entry.\n */\n private renderConsoleEntry(entry: ConsoleEntry): void {\n if (!this.consoleOutput) return;\n\n const line = document.createElement(\"div\");\n line.style.cssText = `\n padding: 0.125rem 0;\n border-bottom: 1px solid var(--dv-separator-border, rgba(0,0,0,0.1));\n `;\n\n if (entry.level === \"error\") {\n line.style.color = \"#f44336\";\n } else if (entry.level === \"warning\") {\n line.style.color = \"#ff9800\";\n }\n\n const time = entry.timestamp.toLocaleTimeString();\n line.textContent = `[${time}] ${entry.message}`;\n\n this.consoleOutput.appendChild(line);\n this.consoleOutput.scrollTop = this.consoleOutput.scrollHeight;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DockViewPlayground.js","sourceRoot":"","sources":["../../../../src/web/components/DockViewPlayground.ts"],"names":[],"mappings":";;;;;AAaA,iDAAoH;AACpH,0EAA8E;AAoF9E,MAAM,cAAc,GAA6B;IAC/C,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,UAAU,EAAE,6BAA6B;IACzC,aAAa,EAAE,CAAC;IAChB,UAAU,EAAE,IAAI;CACjB,CAAC;AA4BF,MAAqB,kBAAkB;IAyBrC,YAAY,SAAsB,EAAE,SAAmC,EAAE;;QAjBjE,aAAQ,GAAuB,IAAI,CAAC;QAGpC,qBAAgB,GAA4B,IAAI,CAAC;QAGjD,kBAAa,GAAuB,IAAI,CAAC;QAGzC,mBAAc,GAAmB,EAAE,CAAC;QAS1C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,mCAAQ,cAAc,GAAK,MAAM,CAAE,CAAC;QAC/C,IAAI,CAAC,eAAe,GAAG,MAAA,IAAI,CAAC,MAAM,CAAC,WAAW,mCAAI,IAAI,CAAC;QAEvD,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAKD,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAKD,IAAI,MAAM;;QACR,OAAO,CAAA,MAAA,IAAI,CA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AAK,CAAC,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAClD,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;QAEhD,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,aAAa,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC;IACjE,CAAC;CACF;AAtgBD,qCAsgBC","sourcesContent":["/**\n * DockViewPlayground - A complete notation playground with DockView layout.\n *\n * Provides a ready-to-use playground experience with:\n * - Resizable editor panel\n * - Resizable notation output panel\n * - Optional console panel for logs/errors\n * - Layout persistence to localStorage\n * - Dark mode support\n *\n * Uses SideBySideEditor internally for editor/output management.\n */\n\nimport { DockviewComponent, DockviewApi, IContentRenderer, Parameters, themeLight, themeDark } from \"dockview-core\";\nimport SideBySideEditor, { SideBySideEditorConfig } from \"./SideBySideEditor\";\nimport { Notation } from \"../../notation\";\nimport { GlobalBeatLayout } from \"../../beats\";\n\n/**\n * Configuration for DockViewPlayground.\n */\nexport interface DockViewPlaygroundConfig {\n /**\n * Initial source text.\n */\n initialSource?: string;\n\n /**\n * Whether to show the console panel initially.\n * @default true\n */\n showConsole?: boolean;\n\n /**\n * Whether to persist layout to localStorage.\n * @default true\n */\n persistLayout?: boolean;\n\n /**\n * Storage key for layout persistence.\n * @default \"notations-playground-layout\"\n */\n storageKey?: string;\n\n /**\n * Layout version number. Increment to force layout reset when structure changes.\n * @default 1\n */\n layoutVersion?: number;\n\n /**\n * Whether to enable scroll synchronization between editor and output.\n * @default true\n */\n syncScroll?: boolean;\n\n /**\n * Optional markdown parser for RawBlock content.\n */\n markdownParser?: (content: string) => string;\n\n /**\n * SideBySideEditor configuration options.\n */\n editorConfig?: Partial<SideBySideEditorConfig>;\n\n /**\n * Callback when source changes.\n */\n onSourceChange?: (source: string) => void;\n\n /**\n * Callback when notation is successfully parsed.\n */\n onNotationParsed?: (notation: Notation, beatLayout: GlobalBeatLayout) => void;\n\n /**\n * Callback when parsing fails.\n */\n onParseError?: (errors: any[]) => void;\n\n /**\n * Function to detect dark mode. If not provided, checks for \"dark\" class on documentElement.\n */\n isDarkMode?: () => boolean;\n\n /**\n * CSS class for the editor textarea.\n */\n editorClass?: string;\n\n /**\n * CSS class for the output container.\n */\n outputClass?: string;\n}\n\nconst DEFAULT_CONFIG: DockViewPlaygroundConfig = {\n showConsole: true,\n persistLayout: true,\n storageKey: \"notations-playground-layout\",\n layoutVersion: 1,\n syncScroll: true,\n};\n\n/**\n * Console log entry.\n */\ninterface ConsoleEntry {\n timestamp: Date;\n level: \"info\" | \"error\" | \"warning\";\n message: string;\n}\n\n/**\n * DockViewPlayground creates a complete notation playground with DockView layout.\n *\n * Usage:\n * ```typescript\n * const playground = new DockViewPlayground(container, {\n * initialSource: \"s r g m p\",\n * onSourceChange: (source) => console.log(\"Source:\", source),\n * });\n *\n * // Access the SideBySideEditor\n * playground.editor.source = \"new source\";\n *\n * // Log to console panel\n * playground.log(\"Hello!\", \"info\");\n * ```\n */\nexport default class DockViewPlayground {\n /** The container element */\n readonly container: HTMLElement;\n\n /** Configuration */\n readonly config: DockViewPlaygroundConfig;\n\n /** DockView API */\n private dockview: DockviewApi | null = null;\n\n /** SideBySideEditor instance */\n private sideBySideEditor: SideBySideEditor | null = null;\n\n /** Console output element */\n private consoleOutput: HTMLElement | null = null;\n\n /** Console entries */\n private consoleEntries: ConsoleEntry[] = [];\n\n /**\n * Creates a new DockViewPlayground.\n *\n * @param container The container element for the playground\n * @param config Configuration options\n */\n constructor(container: HTMLElement, config: DockViewPlaygroundConfig = {}) {\n this.container = container;\n this.config = { ...DEFAULT_CONFIG, ...config };\n this._consoleVisible = this.config.showConsole ?? true;\n\n this.init();\n }\n\n /**\n * Gets the SideBySideEditor instance.\n */\n get editor(): SideBySideEditor | null {\n return this.sideBySideEditor;\n }\n\n /**\n * Gets the current source.\n */\n get source(): string {\n return this.sideBySideEditor?.source || \"\";\n }\n\n /**\n * Sets the source and re-renders.\n */\n set source(value: string) {\n if (this.sideBySideEditor) {\n this.sideBySideEditor.source = value;\n }\n }\n\n /**\n * Logs a message to the console panel.\n */\n log(message: string, level: \"info\" | \"error\" | \"warning\" = \"info\"): void {\n const entry: ConsoleEntry = {\n timestamp: new Date(),\n level,\n message,\n };\n this.consoleEntries.push(entry);\n this.renderConsoleEntry(entry);\n }\n\n /**\n * Clears the console.\n */\n clearConsole(): void {\n this.consoleEntries = [];\n if (this.consoleOutput) {\n this.consoleOutput.innerHTML = \"\";\n }\n }\n\n /**\n * Renders the notation manually.\n */\n render(): boolean {\n return this.sideBySideEditor?.render() || false;\n }\n\n /**\n * Destroys the playground and cleans up resources.\n */\n destroy(): void {\n this.sideBySideEditor?.destroy();\n this.dockview?.dispose();\n this.container.innerHTML = \"\";\n }\n\n /**\n * Resets the layout to defaults.\n * Clears persisted layout and recreates the default layout.\n */\n resetLayout(): void {\n if (this.config.storageKey) {\n localStorage.removeItem(this.config.storageKey);\n }\n if (this.dockview) {\n this.dockview.clear();\n this.createDefaultLayout();\n }\n }\n\n // Console visibility API\n\n /** Whether the console is currently visible */\n private _consoleVisible: boolean;\n\n /**\n * Returns whether the console panel is currently visible.\n */\n isConsoleVisible(): boolean {\n return this._consoleVisible;\n }\n\n /**\n * Shows the console panel.\n */\n showConsole(): void {\n if (this._consoleVisible || !this.dockview) return;\n\n // Add console below editor (spans full width at bottom)\n this.dockview.addPanel({\n id: \"console\",\n component: \"console\",\n title: \"Console\",\n position: { direction: \"below\", referencePanel: \"editor\" },\n });\n\n // Set console to ~10% height\n const consolePanel = this.dockview.getPanel(\"console\");\n const containerHeight = this.container.clientHeight || 600;\n if (consolePanel?.group?.api) {\n consolePanel.group.api.setSize({ height: Math.floor(containerHeight * 0.1) });\n }\n\n this._consoleVisible = true;\n }\n\n /**\n * Hides the console panel.\n */\n hideConsole(): void {\n if (!this._consoleVisible || !this.dockview) return;\n\n const consolePanel = this.dockview.getPanel(\"console\");\n if (consolePanel) {\n consolePanel.api.close();\n }\n this._consoleVisible = false;\n }\n\n /**\n * Toggles the console panel visibility.\n * @returns The new visibility state.\n */\n toggleConsole(): boolean {\n if (this._consoleVisible) {\n this.hideConsole();\n } else {\n this.showConsole();\n }\n return this._consoleVisible;\n }\n\n /**\n * Initializes the playground.\n */\n private init(): void {\n // Ensure container has proper sizing for DockView\n // DockView requires explicit height on its container\n if (!this.container.style.height && !this.container.offsetHeight) {\n this.container.style.height = \"100%\";\n }\n this.container.style.width = this.container.style.width || \"100%\";\n\n // Create DockView with correct theme\n const isDark = this.isDarkMode();\n const dockviewComponent = new DockviewComponent(this.container, {\n createComponent: (options) => this.createComponent(options),\n theme: isDark ? themeDark : themeLight,\n });\n\n // Watch for theme changes and update DockView theme\n const observer = new MutationObserver(() => {\n const dark = this.isDarkMode();\n dockviewComponent.updateOptions({ theme: dark ? themeDark : themeLight });\n });\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"class\"],\n });\n\n this.dockview = dockviewComponent.api;\n\n // Try to restore saved layout, otherwise create default\n if (!this.config.persistLayout || !this.loadLayout()) {\n this.createDefaultLayout();\n }\n\n // Listen for layout changes to persist them\n if (this.config.persistLayout) {\n this.dockview.onDidLayoutChange(() => {\n this.saveLayout();\n });\n }\n\n // Trigger initial render after layout is ready and DOM has updated\n // The SideBySideEditor renders in its constructor, but the output element\n // isn't in the DOM yet at that point, so we need to re-render once everything is attached\n requestAnimationFrame(() => {\n this.render();\n });\n\n this.log(\"Playground initialized\", \"info\");\n }\n\n /**\n * Checks if dark mode is active.\n */\n private isDarkMode(): boolean {\n if (this.config.isDarkMode) {\n return this.config.isDarkMode();\n }\n return document.documentElement.classList.contains(\"dark\");\n }\n\n /**\n * Saves the layout to localStorage.\n */\n private saveLayout(): void {\n if (!this.dockview || !this.config.storageKey) return;\n try {\n const layout = this.dockview.toJSON();\n const data = {\n version: this.config.layoutVersion,\n layout,\n };\n localStorage.setItem(this.config.storageKey, JSON.stringify(data));\n } catch (e) {\n console.warn(\"Failed to save layout:\", e);\n }\n }\n\n /**\n * Loads the layout from localStorage.\n */\n private loadLayout(): boolean {\n if (!this.dockview || !this.config.storageKey) return false;\n try {\n const saved = localStorage.getItem(this.config.storageKey);\n if (saved) {\n const data = JSON.parse(saved);\n // Check version - if outdated or missing, reset to defaults\n if (data.version !== this.config.layoutVersion) {\n localStorage.removeItem(this.config.storageKey);\n return false;\n }\n this.dockview.fromJSON(data.layout);\n return true;\n }\n } catch (e) {\n console.warn(\"Failed to load layout:\", e);\n if (this.config.storageKey) {\n localStorage.removeItem(this.config.storageKey);\n }\n }\n return false;\n }\n\n /**\n * Creates a component for DockView.\n */\n private createComponent(options: any): IContentRenderer {\n switch (options.name) {\n case \"editor\":\n return this.createEditorPanel();\n case \"output\":\n return this.createOutputPanel();\n case \"console\":\n return this.createConsolePanel();\n default:\n return {\n element: document.createElement(\"div\"),\n init: () => {},\n };\n }\n }\n\n /**\n * Creates the default layout.\n * Layout: Editor and Output side by side on top (80% height),\n * Console spanning full width on bottom (20% height).\n */\n private createDefaultLayout(): void {\n if (!this.dockview) return;\n\n // Get container dimensions for proportional sizing\n const containerHeight = this.container.clientHeight || 600;\n const containerWidth = this.container.clientWidth || 800;\n\n // Editor panel (top left)\n this.dockview.addPanel({\n id: \"editor\",\n component: \"editor\",\n title: \"Editor\",\n });\n\n // Console panel (bottom, full width) - add BEFORE output\n // so it creates a vertical split at the root level\n if (this._consoleVisible) {\n this.dockview.addPanel({\n id: \"console\",\n component: \"console\",\n title: \"Console\",\n position: { direction: \"below\", referencePanel: \"editor\" },\n });\n }\n\n // Output panel (top right) - splits the top row\n this.dockview.addPanel({\n id: \"output\",\n component: \"output\",\n title: \"Notation Output\",\n position: { direction: \"right\", referencePanel: \"editor\" },\n });\n\n // Set sizes using the group API\n const editorPanel = this.dockview.getPanel(\"editor\");\n const consolePanel = this.dockview.getPanel(\"console\");\n const outputPanel = this.dockview.getPanel(\"output\");\n\n // Set console height to ~10% of container\n if (consolePanel?.group?.api) {\n consolePanel.group.api.setSize({ height: Math.floor(containerHeight * 0.1) });\n }\n\n // Set editor and output to 50% width each\n if (editorPanel?.group?.api) {\n editorPanel.group.api.setSize({ width: Math.floor(containerWidth * 0.5) });\n }\n if (outputPanel?.group?.api) {\n outputPanel.group.api.setSize({ width: Math.floor(containerWidth * 0.5) });\n }\n }\n\n /**\n * Creates the editor panel.\n */\n private createEditorPanel(): IContentRenderer {\n const element = document.createElement(\"div\");\n element.className = \"dvp-panel dvp-editor-panel\";\n element.style.cssText = \"display: flex; flex-direction: column; height: 100%; padding: 0.5rem;\";\n\n return {\n element,\n init: (_params: Parameters) => {\n // Create SideBySideEditor config\n const editorConfig: SideBySideEditorConfig = {\n initialSource: this.config.initialSource,\n debounceDelay: 300,\n syncScroll: this.config.syncScroll,\n markdownParser: this.config.markdownParser,\n ...this.config.editorConfig,\n onSourceChange: (source) => {\n this.log(`Source changed (${source.length} chars)`, \"info\");\n this.config.onSourceChange?.(source);\n this.config.editorConfig?.onSourceChange?.(source);\n },\n onNotationParsed: (notation, beatLayout) => {\n const lineCount = beatLayout.gridModelsForLine.size;\n this.log(`Parsed: ${lineCount} line${lineCount !== 1 ? \"s\" : \"\"}`, \"info\");\n this.config.onNotationParsed?.(notation, beatLayout);\n this.config.editorConfig?.onNotationParsed?.(notation, beatLayout);\n },\n onParseError: (errors) => {\n errors.forEach((e) => {\n this.log(`Parse error: ${e.message || e}`, \"error\");\n });\n this.config.onParseError?.(errors);\n this.config.editorConfig?.onParseError?.(errors);\n },\n editorClass: this.config.editorClass,\n };\n\n // Create the editor\n this.sideBySideEditor = new SideBySideEditor(editorConfig);\n\n // Style the editor element\n const editorEl = this.sideBySideEditor.editorElement;\n editorEl.style.cssText = `\n width: 100%;\n height: 100%;\n resize: none;\n font-family: \"SF Mono\", \"Monaco\", \"Inconsolata\", \"Fira Code\", monospace;\n font-size: 14px;\n padding: 0.5rem;\n border: 1px solid var(--dv-separator-border, #ddd);\n border-radius: 4px;\n outline: none;\n `;\n\n element.appendChild(editorEl);\n },\n };\n }\n\n /**\n * Creates the output panel.\n */\n private createOutputPanel(): IContentRenderer {\n const element = document.createElement(\"div\");\n element.className = \"dvp-panel dvp-output-panel\";\n element.style.cssText = \"display: flex; flex-direction: column; height: 100%;\";\n\n return {\n element,\n init: (_params: Parameters) => {\n if (this.sideBySideEditor) {\n // Style the output element\n const outputEl = this.sideBySideEditor.outputElement;\n outputEl.style.cssText = `\n width: 100%;\n height: 100%;\n overflow: auto;\n padding: 1rem;\n `;\n\n element.appendChild(outputEl);\n }\n },\n };\n }\n\n /**\n * Creates the console panel.\n */\n private createConsolePanel(): IContentRenderer {\n const element = document.createElement(\"div\");\n element.className = \"dvp-panel dvp-console-panel\";\n element.style.cssText = \"display: flex; flex-direction: column; height: 100%;\";\n\n return {\n element,\n init: (_params: Parameters) => {\n // Console header\n const header = document.createElement(\"div\");\n header.className = \"dvp-console-header\";\n header.style.cssText = `\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.25rem 0.5rem;\n font-size: 0.75rem;\n `;\n\n const clearBtn = document.createElement(\"button\");\n clearBtn.className = \"dvp-console-clear-btn\";\n clearBtn.textContent = \"Clear\";\n clearBtn.style.cssText = `\n padding: 0.125rem 0.5rem;\n font-size: 0.75rem;\n border-radius: 3px;\n cursor: pointer;\n `;\n clearBtn.onclick = () => this.clearConsole();\n header.appendChild(clearBtn);\n\n element.appendChild(header);\n\n // Console output\n this.consoleOutput = document.createElement(\"div\");\n this.consoleOutput.className = \"dvp-console-output\";\n this.consoleOutput.style.cssText = `\n flex: 1;\n overflow: auto;\n padding: 0.5rem;\n font-family: \"SF Mono\", \"Monaco\", \"Inconsolata\", monospace;\n font-size: 0.75rem;\n `;\n element.appendChild(this.consoleOutput);\n\n // Re-render existing entries\n this.consoleEntries.forEach((entry) => this.renderConsoleEntry(entry));\n },\n };\n }\n\n /**\n * Renders a console entry.\n */\n private renderConsoleEntry(entry: ConsoleEntry): void {\n if (!this.consoleOutput) return;\n\n const line = document.createElement(\"div\");\n line.style.cssText = `\n padding: 0.125rem 0;\n border-bottom: 1px solid var(--dv-separator-border, rgba(0,0,0,0.1));\n `;\n\n if (entry.level === \"error\") {\n line.style.color = \"#f44336\";\n } else if (entry.level === \"warning\") {\n line.style.color = \"#ff9800\";\n }\n\n const time = entry.timestamp.toLocaleTimeString();\n line.textContent = `[${time}] ${entry.message}`;\n\n this.consoleOutput.appendChild(line);\n this.consoleOutput.scrollTop = this.consoleOutput.scrollHeight;\n }\n}\n"]}
|
package/lib/esm/beats.d.ts
CHANGED
package/lib/esm/beats.js
CHANGED
|
@@ -57,34 +57,52 @@ export class Beat {
|
|
|
57
57
|
return true;
|
|
58
58
|
}
|
|
59
59
|
get preMarkers() {
|
|
60
|
+
return this.getMarkersWithPosition("before");
|
|
61
|
+
}
|
|
62
|
+
get postMarkers() {
|
|
63
|
+
return this.getMarkersWithPosition("after");
|
|
64
|
+
}
|
|
65
|
+
getMarkersWithPosition(position) {
|
|
60
66
|
const out = [];
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
if (!this.atom)
|
|
68
|
+
return out;
|
|
69
|
+
if (this.atom.TYPE === AtomType.GROUP) {
|
|
70
|
+
const group = this.atom;
|
|
71
|
+
for (const child of group.atoms.values()) {
|
|
72
|
+
if (child.TYPE === AtomType.MARKER) {
|
|
73
|
+
const marker = child;
|
|
74
|
+
if (marker.position === position) {
|
|
75
|
+
out.push(marker);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
68
78
|
}
|
|
69
|
-
|
|
70
|
-
|
|
79
|
+
}
|
|
80
|
+
else if (this.atom.TYPE === AtomType.MARKER) {
|
|
81
|
+
const marker = this.atom;
|
|
82
|
+
if (marker.position === position) {
|
|
83
|
+
out.push(marker);
|
|
71
84
|
}
|
|
72
85
|
}
|
|
73
86
|
return out;
|
|
74
87
|
}
|
|
75
|
-
get
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
get contentAtom() {
|
|
89
|
+
if (!this.atom)
|
|
90
|
+
return null;
|
|
91
|
+
if (this.atom.TYPE === AtomType.MARKER) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
if (this.atom.TYPE !== AtomType.GROUP) {
|
|
95
|
+
return this.atom;
|
|
96
|
+
}
|
|
97
|
+
const group = this.atom;
|
|
98
|
+
let hasNonMarkerContent = false;
|
|
99
|
+
for (const child of group.atoms.values()) {
|
|
100
|
+
if (child.TYPE !== AtomType.MARKER) {
|
|
101
|
+
hasNonMarkerContent = true;
|
|
102
|
+
break;
|
|
85
103
|
}
|
|
86
104
|
}
|
|
87
|
-
return
|
|
105
|
+
return hasNonMarkerContent ? this.atom : null;
|
|
88
106
|
}
|
|
89
107
|
}
|
|
90
108
|
Beat.idCounter = 0;
|
package/lib/esm/beats.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beats.js","sourceRoot":"","sources":["../../src/beats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAU,KAAK,EAAc,KAAK,EAAQ,MAAM,IAAI,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAW,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAClF,OAAO,EAAoB,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG/D,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC;AACnC,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC;AAMjC,M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AAC;QACD,OAAO,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,OAAgB,EAAE,GAAW,EAAE,EAAE;YAClF,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import * as TSU from \"@panyam/tsutils\";\nimport { AtomType, Marker, Group, Line, Atom, Space, Role } from \"./\";\nimport { CycleIterator, CyclePosition } from \"./cycle\";\nimport { WindowIterator } from \"./iterators\";\nimport { LayoutParams } from \"./layouts\";\nimport { GridModel, GridRow, GridCell, ColAlign, GridLayoutGroup } from \"./grids\";\nimport { Block, BlockItem, isLine, isBlock } from \"./notation\";\n\ntype Fraction = TSU.Num.Fraction;\nconst ZERO = TSU.Num.Fraction.ZERO;\nconst ONE = TSU.Num.Fraction.ONE;\n\n/**\n * Represents a single beat in the notation.\n * A beat contains one or more atoms and has a specific position in a bar.\n */\nexport class Beat {\n private static idCounter = 0;\n readonly uuid = Beat.idCounter++;\n // Should this be as flat Atoms or should we keep it as atoms and breakdown later?\n\n /** The atom contained in this beat */\n atom: Atom;\n protected atomIsPlaceholder = false;\n\n /**\n * Creates a new Beat.\n * @param index The index of this beat in the sequence\n * @param role The role this beat belongs to\n * @param offset The time offset of this beat from the start\n * @param duration The duration of this beat\n * @param barIndex The index of the bar containing this beat\n * @param beatIndex The index of this beat within its bar\n * @param instance The instance number of this beat\n * @param prevBeat The previous beat in the sequence, if any\n * @param nextBeat The next beat in the sequence, if any\n */\n constructor(\n public readonly index: number,\n public readonly role: Role,\n public readonly offset: Fraction,\n public readonly duration: Fraction,\n public readonly barIndex: number,\n public readonly beatIndex: number,\n public readonly instance: number,\n public readonly prevBeat: null | Beat,\n public nextBeat: null | Beat,\n ) {}\n\n /**\n * Returns a debug-friendly representation of this Beat.\n * @returns An object containing debug information\n */\n debugValue(): any {\n return {\n index: this.index,\n role: this.role.name,\n offset: this.offset.toString(),\n duration: this.duration.toString(),\n barIndex: this.barIndex,\n beatIndex: this.beatIndex,\n instance: this.instance,\n atom: this.atom.debugValue(),\n };\n }\n\n /**\n * Gets the end offset of this beat (offset + duration).\n */\n get endOffset(): Fraction {\n return this.offset.plus(this.duration);\n }\n\n /**\n * Checks if this beat is filled completely (no remaining space).\n */\n get filled(): boolean {\n return this.remaining.isZero;\n }\n\n /**\n * Gets the remaining duration available in this beat.\n */\n get remaining(): Fraction {\n return this.atom ? this.duration.minus(this.atom.duration, true) : this.duration;\n }\n\n /**\n * Adds an atom to this beat.\n * @param atom The atom to add\n * @returns True if the atom was added successfully, false if there's not enough space\n */\n add(atom: Atom): boolean {\n if (this.remaining.cmp(atom.duration) < 0) {\n return false;\n }\n if (!this.atom) {\n this.atom = atom;\n } else {\n if (!this.atomIsPlaceholder) {\n this.atomIsPlaceholder = true;\n this.atom = new Group(this.atom).setDuration(ONE, true);\n }\n (this.atom as Group).addAtoms(true, atom);\n }\n return true;\n }\n\n /**\n * Gets all markers that should be displayed before this beat.\n * @returns An array of Marker objects\n */\n get preMarkers(): Marker[] {\n const out = [] as Marker[];\n let curr: Atom | null = this.atom;\n while (curr != null) {\n for (const marker of curr.markersBefore || []) {\n out.push(marker);\n }\n if (curr.TYPE == AtomType.GROUP) {\n curr = (curr as Group).atoms.first;\n } else {\n curr = null;\n }\n }\n return out;\n }\n\n /**\n * Gets all markers that should be displayed after this beat.\n * @returns An array of Marker objects\n */\n get postMarkers(): Marker[] {\n const out = [] as Marker[];\n let curr: Atom | null = this.atom;\n while (curr != null) {\n out.splice(0, 0, ...(curr.markersAfter || []));\n if (curr.TYPE == AtomType.GROUP) {\n curr = (curr as Group).atoms.last;\n } else {\n curr = null;\n }\n }\n return out;\n }\n}\n\n/**\n * Builds a sequence of beats from atoms according to layout parameters.\n * Used to convert a flat sequence of atoms into structured beats for display.\n */\nexport class BeatsBuilder {\n /** All atoms divided into beats */\n readonly beats: Beat[] = [];\n readonly startIndex: number;\n readonly beatOffset: Fraction;\n cycleIter: CycleIterator;\n windowIter: WindowIterator;\n\n /** Callback for when an atom is added to this role */\n onAtomAdded: (atom: Atom, beat: Beat) => void;\n\n /** Callback for when a new beat is added */\n onBeatAdded: (beat: Beat) => void;\n\n /** Callback for when a beat has been filled */\n onBeatFilled: (beat: Beat) => void;\n\n /**\n * Creates a new BeatsBuilder.\n * @param role The role containing the atoms\n * @param layoutParams Layout parameters for structuring beats\n * @param startOffset The starting offset for the first beat, defaults to ZERO\n * @param atoms Initial atoms to add to the beats\n */\n constructor(\n public readonly role: Role,\n public readonly layoutParams: LayoutParams,\n public readonly startOffset: Fraction = ZERO,\n ...atoms: Atom[]\n ) {\n const [, [bar, beat, instance], beatOffset, index] = layoutParams.cycle.getPosition(startOffset);\n this.cycleIter = layoutParams.cycle.iterateBeats(bar, beat, instance);\n this.windowIter = new WindowIterator();\n this.beatOffset = beatOffset;\n\n // evaluate the start beatindex - typically it would be 0 if things start\n // at beginning of a cycle. But if the start offset is < 0 then the\n // startIndex should also shift accordingly\n this.startIndex = index;\n this.addAtoms(...atoms);\n }\n\n /**\n * Adds atoms to be processed into beats.\n * @param atoms The atoms to add\n */\n addAtoms(...atoms: Atom[]): void {\n // First add all atoms to the atom Iterator so we can\n // fetch them as FlatAtoms. This is needed because atoms\n // passed here could be unflatted (via groups) or much larger\n // than what can fit in the given role/bar etc. So this\n // flattening and windowing is needed before we add them\n // to the views - and this is done by the durationIterators.\n this.windowIter.push(...atoms);\n while (this.windowIter.hasMore) {\n // get the last/current row and add a new one if it is full\n let currBeat = this.beats[this.beats.length - 1];\n\n // First add a row if last row is filled\n if (this.beats.length == 0 || currBeat.filled) {\n // what should be the beatlengths be here?\n currBeat = this.addBeat();\n }\n\n // For this beat get symbols in all roles\n const [remAtoms, filled] = this.windowIter.get(currBeat.remaining);\n TSU.assert(remAtoms.length > 0, \"Atleast one element should have been available here\");\n // render the atoms now\n for (const atom of remAtoms) {\n // console.log(\"Adding FA: \", flatAtom.debugValue(), flatAtom.atom);\n TSU.assert(currBeat.add(atom), \"Should return true as we are already using a duration iterator here\");\n if (this.onAtomAdded) this.onAtomAdded(atom, currBeat);\n }\n if (currBeat.filled) {\n if (this.onBeatFilled) this.onBeatFilled(currBeat);\n }\n }\n }\n\n /**\n * Adds a new beat to the sequence.\n * @returns The newly created beat\n */\n protected addBeat(): Beat {\n const numBeats = this.beats.length;\n const lastBeat = numBeats == 0 ? null : this.beats[numBeats - 1];\n const nextCP: [CyclePosition, Fraction] = this.cycleIter.next().value;\n const apb = this.layoutParams.beatDuration;\n const newBeat = new Beat(\n lastBeat == null ? this.startIndex : lastBeat.index + 1,\n this.role,\n lastBeat == null ? this.startOffset.minus(this.beatOffset).timesNum(apb, true) : lastBeat.endOffset,\n nextCP[1].timesNum(apb),\n nextCP[0][0],\n nextCP[0][1],\n nextCP[0][2],\n lastBeat,\n null,\n );\n if (lastBeat == null && this.beatOffset.isGT(ZERO)) {\n // Add spaces to fill up empty beats\n newBeat.add(new Space(this.beatOffset.timesNum(apb)));\n }\n if (lastBeat) lastBeat.nextBeat = newBeat;\n this.beats.push(newBeat);\n if (this.onBeatAdded) this.onBeatAdded(newBeat);\n return newBeat;\n }\n}\n\n/**\n * Represents a column of beats in a layout grid.\n * Used for aligning beats vertically in the notation.\n */\nexport class BeatColumn extends ColAlign {\n /** Spacing between atoms in this column */\n atomSpacing = 2;\n /** Unique key for this column */\n readonly key: string;\n\n /**\n * Creates a new BeatColumn.\n * @param offset The starting offset of this column\n * @param endOffset The ending offset of this column\n * @param markerType The type of marker for this column (negative: before, positive: after, zero: normal)\n */\n constructor(\n public readonly offset: Fraction,\n public readonly endOffset: Fraction,\n public readonly markerType: number,\n ) {\n super();\n offset = offset.factorized;\n endOffset = endOffset.factorized;\n this.key = BeatColumn.keyFor(offset, endOffset, markerType);\n }\n\n /**\n * Generates a key for identifying columns with the same offsets and marker type.\n * @param offset The starting offset\n * @param endOffset The ending offset\n * @param markerType The type of marker (negative: before, positive: after, zero: normal)\n * @returns A string key\n */\n static keyFor(offset: Fraction, endOffset: Fraction, markerType = 0): string {\n offset = offset.factorized;\n endOffset = endOffset.factorized;\n if (markerType < 0) {\n // return the column for the marker \"before\" this col\n // int his case only the \"start offset\" is needed and length doesnt matter\n return \":\" + offset.toString();\n } else if (markerType > 0) {\n // return the column for the marker \"after\" this col\n // in this case only thd end offset matters\n return endOffset.toString() + \":\";\n } else {\n return offset.toString() + \":\" + endOffset.toString();\n }\n }\n}\n\n/**\n * Manages the organization of beats into columns based on their offsets.\n * Used to create a directed acyclic graph (DAG) of beat columns for layout purposes.\n *\n * Grouping of beats by their column based on the layout params.\n * The confusion is we have beats broken up and saved in columns\n * but we are loosing how a line is supposed to access it in its own way\n * we have beatsByRole for getting all beats for a role (in a line)\n * sequentially we have beatColumns for getting all beats in a particular\n * column across all lines and roles globally.\n *\n * What we want here is for a given line get all roles, their beats\n * in zipped way. eg for a Line with 3 roles and say 10 beats each\n * (with the breaks of 4, 1) we need:\n *\n * R1 B1 R1 B2 R1 B3 R1 B4\n * R2 B1 R2 B2 R2 B3 R2 B4\n * R3 B1 R3 B2 R3 B3 R3 B4\n *\n * R1 B5\n * R2 B5\n * R3 B5\n *\n * R1 B6 R1 B7 R1 B8 R1 B9\n * R2 B6 R2 B7 R2 B8 R2 B9\n * R3 B6 R3 B7 R3 B8 R3 B9\n *\n * R1 B10\n * R2 B10\n * R3 B10\n *\n *\n * Here we have 5 distinct beat columns:\n *\n * 1: R1B1, R2B1, R3B1, R1B6, R2B6, R3B6,\n * 2: R1B2, R2B2, R3B2, R1B7, R2B7, R3B7,\n * 3: R1B3, R2B3, R3B3, R1B8, R2B8, R3B8,\n * 4: R1B4, R2B4, R3B4, R1B9, R2B9, R3B9,\n * 5: R1B5, R2B5, R3B5, R1B10, R2B10, R3B10,\n *\n */\nexport class BeatColDAG {\n /** Map of column keys to BeatColumn objects */\n beatColumns = new Map<string, BeatColumn>();\n\n /**\n * Creates a new BeatColDAG.\n * @param layoutGroup The layout group to associate with this DAG\n */\n constructor(public readonly layoutGroup: GridLayoutGroup) {\n //\n }\n\n /**\n * Gets the beat column for a given duration at the specified offset.\n * Creates a new column if none exists.\n * @param offset The starting offset\n * @param endOffset The ending offset\n * @param markerType The type of marker\n * @returns The BeatColumn for the specified parameters\n */\n getBeatColumn(offset: Fraction, endOffset: Fraction, markerType = 0): BeatColumn {\n const [bcol, newcreated] = this.ensureBeatColumn(offset, endOffset, markerType);\n if (newcreated) {\n if (markerType == 0) {\n const [prevcol] = this.ensureBeatColumn(offset, endOffset, -1);\n const [nextcol] = this.ensureBeatColumn(offset, endOffset, 1);\n prevcol.addSuccessor(bcol);\n bcol.addSuccessor(nextcol);\n for (const other of this.beatColumns.values()) {\n // only join the \"marker\" columns\n if (other.markerType == -1 && endOffset.equals(other.offset)) {\n // our next col is a preecessor of other\n nextcol.addSuccessor(other);\n } else if (other.markerType == 1 && other.endOffset.equals(offset)) {\n // our prev col is a predecessor of other\n other.addSuccessor(prevcol);\n }\n }\n }\n }\n return bcol;\n }\n\n /**\n * Ensures a beat column exists for the given parameters.\n * @param offset The starting offset\n * @param endOffset The ending offset\n * @param markerType The type of marker\n * @returns A tuple containing the column and whether it was newly created\n */\n protected ensureBeatColumn(offset: Fraction, endOffset: Fraction, markerType = 0): [BeatColumn, boolean] {\n const key = BeatColumn.keyFor(offset, endOffset, markerType);\n let bcol = this.beatColumns.get(key) || null;\n const newcreated = bcol == null;\n if (!bcol) {\n bcol = new BeatColumn(offset, endOffset, markerType);\n this.beatColumns.set(key, bcol);\n }\n return [bcol, newcreated];\n }\n}\n\n/** Type alias for line IDs */\ntype LineId = number;\n/** Type alias for layout parameter IDs */\ntype LPID = number;\n\n/**\n * Manages the beat layouts for all lines in a notation.\n * Handles the creation of grid models, positioning of beats, and alignment of beats across lines.\n */\nexport class GlobalBeatLayout {\n /** Map of line IDs to grid models */\n gridModelsForLine = new Map<LineId, GridModel>();\n /** Map of line IDs to arrays of beats for each role */\n roleBeatsForLine = new Map<LineId, Beat[][]>();\n /** Map of layout parameter IDs to beat column DAGs */\n beatColDAGsByLP = new Map<LPID, BeatColDAG>();\n /** The global layout group for all grid models */\n readonly gridLayoutGroup: GridLayoutGroup;\n\n /**\n * Creates a new GlobalBeatLayout.\n * @param sharedGridLayoutGroup Optional shared GridLayoutGroup for column alignment across multiple views.\n * If not provided, a new GridLayoutGroup is created internally.\n */\n constructor(sharedGridLayoutGroup?: GridLayoutGroup) {\n this.gridLayoutGroup = sharedGridLayoutGroup ?? new GridLayoutGroup();\n }\n\n /**\n * Gets the GridModel associated with a particular line, creating one if it doesn't exist.\n * @param lineid The ID of the line\n * @returns The GridModel for the line\n */\n getGridModelForLine(lineid: LineId): GridModel {\n let out = this.gridModelsForLine.get(lineid) || null;\n if (!out) {\n out = new GridModel();\n this.gridLayoutGroup.addGridModel(out);\n this.gridModelsForLine.set(lineid, out);\n }\n return out;\n }\n\n /**\n * Gets the BeatColDAG for a specific layout parameter ID, creating one if it doesn't exist.\n * @param lpid The layout parameter ID\n * @returns The BeatColDAG for the layout parameters\n */\n protected beatColDAGForLP(lpid: LPID): BeatColDAG {\n let out = this.beatColDAGsByLP.get(lpid) || null;\n if (!out) {\n out = new BeatColDAG(this.gridLayoutGroup);\n this.beatColDAGsByLP.set(lpid, out);\n }\n return out;\n }\n\n /**\n * Adds a line to the beat layout.\n * This ensures that a line is broken down into beats and added into a dedicated GridModel.\n *\n * A line must also be given the layout params by which the beat breakdown will happen.\n * This LayoutParams object does not have to be unique per line (this non-constraint allows\n * beats to be aligned across lines).\n *\n * @param line The line to add\n */\n addLine(line: Line): void {\n const gridModel = this.getGridModelForLine(line.uuid) as GridModel;\n gridModel.eventHub?.startBatchMode();\n this.lineToRoleBeats(line, gridModel);\n gridModel.eventHub?.commitBatch();\n }\n\n /**\n * Recursively processes a block and its children to build beat layouts.\n * Uses block.children() to get expanded children (e.g., RepeatBlock expands to N copies).\n *\n * @param block The block to process\n */\n processBlock(block: Block): void {\n for (const child of block.children()) {\n this.processBlockItem(child);\n }\n }\n\n /**\n * Processes a single block item (Block, Line, or RawBlock).\n *\n * @param item The item to process\n */\n protected processBlockItem(item: BlockItem): void {\n if (isLine(item)) {\n const line = item as Line;\n if (!line.isEmpty && line.layoutParams != null) {\n this.addLine(line);\n }\n } else if (isBlock(item)) {\n this.processBlock(item as Block);\n }\n // RawBlocks are ignored (no beat layout for raw content)\n }\n\n /**\n * Converts a line into a series of beats for each role.\n * @param line The line to convert\n * @param gridModel The grid model to use\n * @returns Arrays of beats for each role\n */\n protected lineToRoleBeats(line: Line, gridModel: GridModel): Beat[][] {\n const lp = line.layoutParams;\n const roleBeats = [] as Beat[][];\n this.roleBeatsForLine.set(line.uuid, roleBeats);\n const lineOffset = line.offset.divbyNum(lp.beatDuration);\n for (const role of line.roles) {\n const bb = new BeatsBuilder(role, lp, lineOffset, ...role.atoms);\n roleBeats.push(bb.beats);\n\n // Add these to the beat layout too\n for (const beat of bb.beats) {\n // beat.ensureUniformSpaces(layoutParams.beatDuration);\n this.addBeat(beat, gridModel);\n }\n }\n return roleBeats;\n }\n\n /**\n * Adds a beat to the layout.\n * @param beat The beat to add\n * @param gridModel The grid model to add the beat to\n * @returns The grid cell containing the beat\n */\n protected addBeat(beat: Beat, gridModel: GridModel): GridCell {\n // Get the beat column at this index (and line) and add to it.\n const line = beat.role.line;\n const lp = line.layoutParams;\n const beatColDAG = this.beatColDAGForLP(lp.uuid);\n const [layoutLine, layoutColumn, rowOffset] = lp.getBeatLocation(beat);\n const colEnd = rowOffset.plus(beat.duration, true);\n const bcol = beatColDAG.getBeatColumn(rowOffset, colEnd, 0);\n\n // Since a beat's column has a \"pre\" and \"post\" col to, each\n // beat has 3 columns for it\n const roleIndex = beat.role.line.indexOfRole(beat.role.name);\n const nthLine = Math.floor(beat.index / lp.totalBeats);\n const realLine = lp.lineBreaks.length * nthLine + layoutLine;\n const realRow = line.roles.length * realLine + roleIndex;\n // pre marker goes on realCol - 1, post marker goes on realCol + 1\n const realCol = 1 + layoutColumn * 3;\n const preMarkers = beat.preMarkers;\n if (preMarkers.length > 0) {\n const val = {\n beat: beat,\n markers: preMarkers,\n };\n const precol = beatColDAG.getBeatColumn(rowOffset, colEnd, -1);\n gridModel.setValue(realRow, realCol - 1, val, (gridRow: GridRow, col: number) => {\n const cell = new GridCell(gridRow, col);\n cell.colAlign = precol;\n return cell;\n });\n }\n const postMarkers = beat.postMarkers;\n if (postMarkers.length > 0) {\n const val = {\n beat: beat,\n markers: postMarkers,\n };\n const postcol = beatColDAG.getBeatColumn(rowOffset, colEnd, 1);\n gridModel.setValue(realRow, realCol + 1, val, (gridRow: GridRow, col: number) => {\n const cell = new GridCell(gridRow, col);\n cell.colAlign = postcol;\n return cell;\n });\n }\n return gridModel.setValue(realRow, realCol, beat, (gridRow: GridRow, col: number) => {\n const cell = new GridCell(gridRow, col);\n cell.colAlign = bcol;\n return cell;\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"beats.js","sourceRoot":"","sources":["../../src/beats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAU,KAAK,EAAc,KAAK,EAAQ,MAAM,IAAI,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAW,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAClF,OAAO,EAAoB,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG/D,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC;AACnC,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC;AAMjC,MAAM,OAAO,IAAI;IAqBf,YACkB,KAAa,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,IAAI,GAAG,IAAI,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBACxC,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;gBACvB,OAAO,IAAI,CAAC;YACd,CAAC,CAAC,CAAC;QACL,CAAC;QACD,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACrC,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,MAAM,GAAG,GAAG;gBACV,IAAI,EAAE,IAAI;gBACV,OAAO,EAAE,WAAW;aACrB,CAAC;YACF,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;YAC/D,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,OAAgB,EAAE,GAAW,EAAE,EAAE;gBAC9E,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBACxC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;gBACxB,OAAO,IAAI,CAAC;YACd,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,OAAgB,EAAE,GAAW,EAAE,EAAE;YAClF,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import * as TSU from \"@panyam/tsutils\";\nimport { AtomType, Marker, Group, Line, Atom, Space, Role } from \"./\";\nimport { CycleIterator, CyclePosition } from \"./cycle\";\nimport { WindowIterator } from \"./iterators\";\nimport { LayoutParams } from \"./layouts\";\nimport { GridModel, GridRow, GridCell, ColAlign, GridLayoutGroup } from \"./grids\";\nimport { Block, BlockItem, isLine, isBlock } from \"./notation\";\n\ntype Fraction = TSU.Num.Fraction;\nconst ZERO = TSU.Num.Fraction.ZERO;\nconst ONE = TSU.Num.Fraction.ONE;\n\n/**\n * Represents a single beat in the notation.\n * A beat contains one or more atoms and has a specific position in a bar.\n */\nexport class Beat {\n private static idCounter = 0;\n readonly uuid = Beat.idCounter++;\n // Should this be as flat Atoms or should we keep it as atoms and breakdown later?\n\n /** The atom contained in this beat */\n atom: Atom;\n protected atomIsPlaceholder = false;\n\n /**\n * Creates a new Beat.\n * @param index The index of this beat in the sequence\n * @param role The role this beat belongs to\n * @param offset The time offset of this beat from the start\n * @param duration The duration of this beat\n * @param barIndex The index of the bar containing this beat\n * @param beatIndex The index of this beat within its bar\n * @param instance The instance number of this beat\n * @param prevBeat The previous beat in the sequence, if any\n * @param nextBeat The next beat in the sequence, if any\n */\n constructor(\n public readonly index: number,\n public readonly role: Role,\n public readonly offset: Fraction,\n public readonly duration: Fraction,\n public readonly barIndex: number,\n public readonly beatIndex: number,\n public readonly instance: number,\n public readonly prevBeat: null | Beat,\n public nextBeat: null | Beat,\n ) {}\n\n /**\n * Returns a debug-friendly representation of this Beat.\n * @returns An object containing debug information\n */\n debugValue(): any {\n return {\n index: this.index,\n role: this.role.name,\n offset: this.offset.toString(),\n duration: this.duration.toString(),\n barIndex: this.barIndex,\n beatIndex: this.beatIndex,\n instance: this.instance,\n atom: this.atom.debugValue(),\n };\n }\n\n /**\n * Gets the end offset of this beat (offset + duration).\n */\n get endOffset(): Fraction {\n return this.offset.plus(this.duration);\n }\n\n /**\n * Checks if this beat is filled completely (no remaining space).\n */\n get filled(): boolean {\n return this.remaining.isZero;\n }\n\n /**\n * Gets the remaining duration available in this beat.\n */\n get remaining(): Fraction {\n return this.atom ? this.duration.minus(this.atom.duration, true) : this.duration;\n }\n\n /**\n * Adds an atom to this beat.\n * @param atom The atom to add\n * @returns True if the atom was added successfully, false if there's not enough space\n */\n add(atom: Atom): boolean {\n if (this.remaining.cmp(atom.duration) < 0) {\n return false;\n }\n if (!this.atom) {\n this.atom = atom;\n } else {\n if (!this.atomIsPlaceholder) {\n this.atomIsPlaceholder = true;\n this.atom = new Group(this.atom).setDuration(ONE, true);\n }\n (this.atom as Group).addAtoms(true, atom);\n }\n return true;\n }\n\n /**\n * Gets all markers that should be displayed before this beat.\n * Extracts Marker atoms with position=\"before\" from the beat's content.\n * @returns An array of Marker objects with position=\"before\"\n */\n get preMarkers(): Marker[] {\n return this.getMarkersWithPosition(\"before\");\n }\n\n /**\n * Gets all markers that should be displayed after this beat.\n * Extracts Marker atoms with position=\"after\" from the beat's content.\n * @returns An array of Marker objects with position=\"after\"\n */\n get postMarkers(): Marker[] {\n return this.getMarkersWithPosition(\"after\");\n }\n\n /**\n * Extracts Marker atoms with the specified position from the beat's content.\n * @param position The position to filter by (\"before\" or \"after\")\n * @returns An array of matching Marker objects\n */\n private getMarkersWithPosition(position: \"before\" | \"after\"): Marker[] {\n const out: Marker[] = [];\n if (!this.atom) return out;\n\n // If the atom is a Group, iterate through its children\n if (this.atom.TYPE === AtomType.GROUP) {\n const group = this.atom as Group;\n for (const child of group.atoms.values()) {\n if (child.TYPE === AtomType.MARKER) {\n const marker = child as Marker;\n if (marker.position === position) {\n out.push(marker);\n }\n }\n }\n } else if (this.atom.TYPE === AtomType.MARKER) {\n // Single marker atom\n const marker = this.atom as Marker;\n if (marker.position === position) {\n out.push(marker);\n }\n }\n\n return out;\n }\n\n /**\n * Gets the content atom for rendering, with markers filtered out.\n * If the beat contains only markers, returns null.\n * Otherwise returns the original atom (views should skip markers during rendering).\n * @returns The content atom, or null if only markers exist\n */\n get contentAtom(): Atom | null {\n if (!this.atom) return null;\n\n // Single marker atom - no content to render\n if (this.atom.TYPE === AtomType.MARKER) {\n return null;\n }\n\n // Not a group - return as-is (it's not a marker at this point)\n if (this.atom.TYPE !== AtomType.GROUP) {\n return this.atom;\n }\n\n // Group - check if it has any non-marker content\n const group = this.atom as Group;\n let hasNonMarkerContent = false;\n for (const child of group.atoms.values()) {\n if (child.TYPE !== AtomType.MARKER) {\n hasNonMarkerContent = true;\n break;\n }\n }\n\n // If all atoms are markers, return null\n // Otherwise return the original group (view will skip markers during iteration)\n return hasNonMarkerContent ? this.atom : null;\n }\n}\n\n/**\n * Builds a sequence of beats from atoms according to layout parameters.\n * Used to convert a flat sequence of atoms into structured beats for display.\n */\nexport class BeatsBuilder {\n /** All atoms divided into beats */\n readonly beats: Beat[] = [];\n readonly startIndex: number;\n readonly beatOffset: Fraction;\n cycleIter: CycleIterator;\n windowIter: WindowIterator;\n\n /** Callback for when an atom is added to this role */\n onAtomAdded: (atom: Atom, beat: Beat) => void;\n\n /** Callback for when a new beat is added */\n onBeatAdded: (beat: Beat) => void;\n\n /** Callback for when a beat has been filled */\n onBeatFilled: (beat: Beat) => void;\n\n /**\n * Creates a new BeatsBuilder.\n * @param role The role containing the atoms\n * @param layoutParams Layout parameters for structuring beats\n * @param startOffset The starting offset for the first beat, defaults to ZERO\n * @param atoms Initial atoms to add to the beats\n */\n constructor(\n public readonly role: Role,\n public readonly layoutParams: LayoutParams,\n public readonly startOffset: Fraction = ZERO,\n ...atoms: Atom[]\n ) {\n const [, [bar, beat, instance], beatOffset, index] = layoutParams.cycle.getPosition(startOffset);\n this.cycleIter = layoutParams.cycle.iterateBeats(bar, beat, instance);\n this.windowIter = new WindowIterator();\n this.beatOffset = beatOffset;\n\n // evaluate the start beatindex - typically it would be 0 if things start\n // at beginning of a cycle. But if the start offset is < 0 then the\n // startIndex should also shift accordingly\n this.startIndex = index;\n this.addAtoms(...atoms);\n }\n\n /**\n * Adds atoms to be processed into beats.\n * @param atoms The atoms to add\n */\n addAtoms(...atoms: Atom[]): void {\n // First add all atoms to the atom Iterator so we can\n // fetch them as FlatAtoms. This is needed because atoms\n // passed here could be unflatted (via groups) or much larger\n // than what can fit in the given role/bar etc. So this\n // flattening and windowing is needed before we add them\n // to the views - and this is done by the durationIterators.\n this.windowIter.push(...atoms);\n while (this.windowIter.hasMore) {\n // get the last/current row and add a new one if it is full\n let currBeat = this.beats[this.beats.length - 1];\n\n // First add a row if last row is filled\n if (this.beats.length == 0 || currBeat.filled) {\n // what should be the beatlengths be here?\n currBeat = this.addBeat();\n }\n\n // For this beat get symbols in all roles\n const [remAtoms, filled] = this.windowIter.get(currBeat.remaining);\n TSU.assert(remAtoms.length > 0, \"Atleast one element should have been available here\");\n // render the atoms now\n for (const atom of remAtoms) {\n // console.log(\"Adding FA: \", flatAtom.debugValue(), flatAtom.atom);\n TSU.assert(currBeat.add(atom), \"Should return true as we are already using a duration iterator here\");\n if (this.onAtomAdded) this.onAtomAdded(atom, currBeat);\n }\n if (currBeat.filled) {\n if (this.onBeatFilled) this.onBeatFilled(currBeat);\n }\n }\n }\n\n /**\n * Adds a new beat to the sequence.\n * @returns The newly created beat\n */\n protected addBeat(): Beat {\n const numBeats = this.beats.length;\n const lastBeat = numBeats == 0 ? null : this.beats[numBeats - 1];\n const nextCP: [CyclePosition, Fraction] = this.cycleIter.next().value;\n const apb = this.layoutParams.beatDuration;\n const newBeat = new Beat(\n lastBeat == null ? this.startIndex : lastBeat.index + 1,\n this.role,\n lastBeat == null ? this.startOffset.minus(this.beatOffset).timesNum(apb, true) : lastBeat.endOffset,\n nextCP[1].timesNum(apb),\n nextCP[0][0],\n nextCP[0][1],\n nextCP[0][2],\n lastBeat,\n null,\n );\n if (lastBeat == null && this.beatOffset.isGT(ZERO)) {\n // Add spaces to fill up empty beats\n newBeat.add(new Space(this.beatOffset.timesNum(apb)));\n }\n if (lastBeat) lastBeat.nextBeat = newBeat;\n this.beats.push(newBeat);\n if (this.onBeatAdded) this.onBeatAdded(newBeat);\n return newBeat;\n }\n}\n\n/**\n * Represents a column of beats in a layout grid.\n * Used for aligning beats vertically in the notation.\n */\nexport class BeatColumn extends ColAlign {\n /** Spacing between atoms in this column */\n atomSpacing = 2;\n /** Unique key for this column */\n readonly key: string;\n\n /**\n * Creates a new BeatColumn.\n * @param offset The starting offset of this column\n * @param endOffset The ending offset of this column\n * @param markerType The type of marker for this column (negative: before, positive: after, zero: normal)\n */\n constructor(\n public readonly offset: Fraction,\n public readonly endOffset: Fraction,\n public readonly markerType: number,\n ) {\n super();\n offset = offset.factorized;\n endOffset = endOffset.factorized;\n this.key = BeatColumn.keyFor(offset, endOffset, markerType);\n }\n\n /**\n * Generates a key for identifying columns with the same offsets and marker type.\n * @param offset The starting offset\n * @param endOffset The ending offset\n * @param markerType The type of marker (negative: before, positive: after, zero: normal)\n * @returns A string key\n */\n static keyFor(offset: Fraction, endOffset: Fraction, markerType = 0): string {\n offset = offset.factorized;\n endOffset = endOffset.factorized;\n if (markerType < 0) {\n // return the column for the marker \"before\" this col\n // int his case only the \"start offset\" is needed and length doesnt matter\n return \":\" + offset.toString();\n } else if (markerType > 0) {\n // return the column for the marker \"after\" this col\n // in this case only thd end offset matters\n return endOffset.toString() + \":\";\n } else {\n return offset.toString() + \":\" + endOffset.toString();\n }\n }\n}\n\n/**\n * Manages the organization of beats into columns based on their offsets.\n * Used to create a directed acyclic graph (DAG) of beat columns for layout purposes.\n *\n * Grouping of beats by their column based on the layout params.\n * The confusion is we have beats broken up and saved in columns\n * but we are loosing how a line is supposed to access it in its own way\n * we have beatsByRole for getting all beats for a role (in a line)\n * sequentially we have beatColumns for getting all beats in a particular\n * column across all lines and roles globally.\n *\n * What we want here is for a given line get all roles, their beats\n * in zipped way. eg for a Line with 3 roles and say 10 beats each\n * (with the breaks of 4, 1) we need:\n *\n * R1 B1 R1 B2 R1 B3 R1 B4\n * R2 B1 R2 B2 R2 B3 R2 B4\n * R3 B1 R3 B2 R3 B3 R3 B4\n *\n * R1 B5\n * R2 B5\n * R3 B5\n *\n * R1 B6 R1 B7 R1 B8 R1 B9\n * R2 B6 R2 B7 R2 B8 R2 B9\n * R3 B6 R3 B7 R3 B8 R3 B9\n *\n * R1 B10\n * R2 B10\n * R3 B10\n *\n *\n * Here we have 5 distinct beat columns:\n *\n * 1: R1B1, R2B1, R3B1, R1B6, R2B6, R3B6,\n * 2: R1B2, R2B2, R3B2, R1B7, R2B7, R3B7,\n * 3: R1B3, R2B3, R3B3, R1B8, R2B8, R3B8,\n * 4: R1B4, R2B4, R3B4, R1B9, R2B9, R3B9,\n * 5: R1B5, R2B5, R3B5, R1B10, R2B10, R3B10,\n *\n */\nexport class BeatColDAG {\n /** Map of column keys to BeatColumn objects */\n beatColumns = new Map<string, BeatColumn>();\n\n /**\n * Creates a new BeatColDAG.\n * @param layoutGroup The layout group to associate with this DAG\n */\n constructor(public readonly layoutGroup: GridLayoutGroup) {\n //\n }\n\n /**\n * Gets the beat column for a given duration at the specified offset.\n * Creates a new column if none exists.\n * @param offset The starting offset\n * @param endOffset The ending offset\n * @param markerType The type of marker\n * @returns The BeatColumn for the specified parameters\n */\n getBeatColumn(offset: Fraction, endOffset: Fraction, markerType = 0): BeatColumn {\n const [bcol, newcreated] = this.ensureBeatColumn(offset, endOffset, markerType);\n if (newcreated) {\n if (markerType == 0) {\n const [prevcol] = this.ensureBeatColumn(offset, endOffset, -1);\n const [nextcol] = this.ensureBeatColumn(offset, endOffset, 1);\n prevcol.addSuccessor(bcol);\n bcol.addSuccessor(nextcol);\n for (const other of this.beatColumns.values()) {\n // only join the \"marker\" columns\n if (other.markerType == -1 && endOffset.equals(other.offset)) {\n // our next col is a preecessor of other\n nextcol.addSuccessor(other);\n } else if (other.markerType == 1 && other.endOffset.equals(offset)) {\n // our prev col is a predecessor of other\n other.addSuccessor(prevcol);\n }\n }\n }\n }\n return bcol;\n }\n\n /**\n * Ensures a beat column exists for the given parameters.\n * @param offset The starting offset\n * @param endOffset The ending offset\n * @param markerType The type of marker\n * @returns A tuple containing the column and whether it was newly created\n */\n protected ensureBeatColumn(offset: Fraction, endOffset: Fraction, markerType = 0): [BeatColumn, boolean] {\n const key = BeatColumn.keyFor(offset, endOffset, markerType);\n let bcol = this.beatColumns.get(key) || null;\n const newcreated = bcol == null;\n if (!bcol) {\n bcol = new BeatColumn(offset, endOffset, markerType);\n this.beatColumns.set(key, bcol);\n }\n return [bcol, newcreated];\n }\n}\n\n/** Type alias for line IDs */\ntype LineId = number;\n/** Type alias for layout parameter IDs */\ntype LPID = number;\n\n/**\n * Manages the beat layouts for all lines in a notation.\n * Handles the creation of grid models, positioning of beats, and alignment of beats across lines.\n */\nexport class GlobalBeatLayout {\n /** Map of line IDs to grid models */\n gridModelsForLine = new Map<LineId, GridModel>();\n /** Map of line IDs to arrays of beats for each role */\n roleBeatsForLine = new Map<LineId, Beat[][]>();\n /** Map of layout parameter IDs to beat column DAGs */\n beatColDAGsByLP = new Map<LPID, BeatColDAG>();\n /** The global layout group for all grid models */\n readonly gridLayoutGroup: GridLayoutGroup;\n\n /**\n * Creates a new GlobalBeatLayout.\n * @param sharedGridLayoutGroup Optional shared GridLayoutGroup for column alignment across multiple views.\n * If not provided, a new GridLayoutGroup is created internally.\n */\n constructor(sharedGridLayoutGroup?: GridLayoutGroup) {\n this.gridLayoutGroup = sharedGridLayoutGroup ?? new GridLayoutGroup();\n }\n\n /**\n * Gets the GridModel associated with a particular line, creating one if it doesn't exist.\n * @param lineid The ID of the line\n * @returns The GridModel for the line\n */\n getGridModelForLine(lineid: LineId): GridModel {\n let out = this.gridModelsForLine.get(lineid) || null;\n if (!out) {\n out = new GridModel();\n this.gridLayoutGroup.addGridModel(out);\n this.gridModelsForLine.set(lineid, out);\n }\n return out;\n }\n\n /**\n * Gets the BeatColDAG for a specific layout parameter ID, creating one if it doesn't exist.\n * @param lpid The layout parameter ID\n * @returns The BeatColDAG for the layout parameters\n */\n protected beatColDAGForLP(lpid: LPID): BeatColDAG {\n let out = this.beatColDAGsByLP.get(lpid) || null;\n if (!out) {\n out = new BeatColDAG(this.gridLayoutGroup);\n this.beatColDAGsByLP.set(lpid, out);\n }\n return out;\n }\n\n /**\n * Adds a line to the beat layout.\n * This ensures that a line is broken down into beats and added into a dedicated GridModel.\n *\n * A line must also be given the layout params by which the beat breakdown will happen.\n * This LayoutParams object does not have to be unique per line (this non-constraint allows\n * beats to be aligned across lines).\n *\n * @param line The line to add\n */\n addLine(line: Line): void {\n const gridModel = this.getGridModelForLine(line.uuid) as GridModel;\n gridModel.eventHub?.startBatchMode();\n this.lineToRoleBeats(line, gridModel);\n gridModel.eventHub?.commitBatch();\n }\n\n /**\n * Recursively processes a block and its children to build beat layouts.\n * Uses block.children() to get expanded children (e.g., RepeatBlock expands to N copies).\n *\n * @param block The block to process\n */\n processBlock(block: Block): void {\n for (const child of block.children()) {\n this.processBlockItem(child);\n }\n }\n\n /**\n * Processes a single block item (Block, Line, or RawBlock).\n *\n * @param item The item to process\n */\n protected processBlockItem(item: BlockItem): void {\n if (isLine(item)) {\n const line = item as Line;\n if (!line.isEmpty && line.layoutParams != null) {\n this.addLine(line);\n }\n } else if (isBlock(item)) {\n this.processBlock(item as Block);\n }\n // RawBlocks are ignored (no beat layout for raw content)\n }\n\n /**\n * Converts a line into a series of beats for each role.\n * @param line The line to convert\n * @param gridModel The grid model to use\n * @returns Arrays of beats for each role\n */\n protected lineToRoleBeats(line: Line, gridModel: GridModel): Beat[][] {\n const lp = line.layoutParams;\n const roleBeats = [] as Beat[][];\n this.roleBeatsForLine.set(line.uuid, roleBeats);\n const lineOffset = line.offset.divbyNum(lp.beatDuration);\n for (const role of line.roles) {\n const bb = new BeatsBuilder(role, lp, lineOffset, ...role.atoms);\n roleBeats.push(bb.beats);\n\n // Add these to the beat layout too\n for (const beat of bb.beats) {\n // beat.ensureUniformSpaces(layoutParams.beatDuration);\n this.addBeat(beat, gridModel);\n }\n }\n return roleBeats;\n }\n\n /**\n * Adds a beat to the layout.\n * @param beat The beat to add\n * @param gridModel The grid model to add the beat to\n * @returns The grid cell containing the beat\n */\n protected addBeat(beat: Beat, gridModel: GridModel): GridCell {\n // Get the beat column at this index (and line) and add to it.\n const line = beat.role.line;\n const lp = line.layoutParams;\n const beatColDAG = this.beatColDAGForLP(lp.uuid);\n const [layoutLine, layoutColumn, rowOffset] = lp.getBeatLocation(beat);\n const colEnd = rowOffset.plus(beat.duration, true);\n const bcol = beatColDAG.getBeatColumn(rowOffset, colEnd, 0);\n\n // Since a beat's column has a \"pre\" and \"post\" col to, each\n // beat has 3 columns for it\n const roleIndex = beat.role.line.indexOfRole(beat.role.name);\n const nthLine = Math.floor(beat.index / lp.totalBeats);\n const realLine = lp.lineBreaks.length * nthLine + layoutLine;\n const realRow = line.roles.length * realLine + roleIndex;\n // pre marker goes on realCol - 1, post marker goes on realCol + 1\n const realCol = 1 + layoutColumn * 3;\n const preMarkers = beat.preMarkers;\n if (preMarkers.length > 0) {\n const val = {\n beat: beat,\n markers: preMarkers,\n };\n const precol = beatColDAG.getBeatColumn(rowOffset, colEnd, -1);\n gridModel.setValue(realRow, realCol - 1, val, (gridRow: GridRow, col: number) => {\n const cell = new GridCell(gridRow, col);\n cell.colAlign = precol;\n return cell;\n });\n }\n const postMarkers = beat.postMarkers;\n if (postMarkers.length > 0) {\n const val = {\n beat: beat,\n markers: postMarkers,\n };\n const postcol = beatColDAG.getBeatColumn(rowOffset, colEnd, 1);\n gridModel.setValue(realRow, realCol + 1, val, (gridRow: GridRow, col: number) => {\n const cell = new GridCell(gridRow, col);\n cell.colAlign = postcol;\n return cell;\n });\n }\n return gridModel.setValue(realRow, realCol, beat, (gridRow: GridRow, col: number) => {\n const cell = new GridCell(gridRow, col);\n cell.colAlign = bcol;\n return cell;\n });\n }\n}\n"]}
|
package/lib/esm/beatview.d.ts
CHANGED
|
@@ -8,11 +8,11 @@ export declare abstract class BeatView extends ElementShape<SVGGElement> impleme
|
|
|
8
8
|
readonly rootElement: SVGGraphicsElement;
|
|
9
9
|
readonly cycle: Cycle;
|
|
10
10
|
private _embelishments;
|
|
11
|
-
atomView: AtomView;
|
|
11
|
+
atomView: AtomView | null;
|
|
12
12
|
needsLayout: boolean;
|
|
13
13
|
constructor(cell: GridCell, beat: Beat, rootElement: SVGGraphicsElement, cycle: Cycle, config?: any);
|
|
14
14
|
get embelishments(): Embelishment[];
|
|
15
15
|
setStyles(config: any): void;
|
|
16
16
|
protected abstract createEmbelishments(): Embelishment[];
|
|
17
|
-
protected abstract createAtomView(): AtomView;
|
|
17
|
+
protected abstract createAtomView(): AtomView | null;
|
|
18
18
|
}
|
package/lib/esm/beatview.js
CHANGED
|
@@ -20,7 +20,9 @@ export class BeatView extends ElementShape {
|
|
|
20
20
|
this.cycle = cycle;
|
|
21
21
|
this.needsLayout = true;
|
|
22
22
|
this.atomView = this.createAtomView();
|
|
23
|
-
this.atomView
|
|
23
|
+
if (this.atomView) {
|
|
24
|
+
this.atomView.refreshLayout();
|
|
25
|
+
}
|
|
24
26
|
}
|
|
25
27
|
get embelishments() {
|
|
26
28
|
if (!this._embelishments) {
|
package/lib/esm/beatview.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beatview.js","sourceRoot":"","sources":["../../src/beatview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAA0B,YAAY,EAAE,MAAM,UAAU,CAAC;AAUhE,MAAM,OAAgB,QAAS,SAAQ,YAAyB;IAkB9D,YACkB,IAAc,EACd,IAAU,EACV,WAA+B,EAC/B,KAAY,EAC5B,MAAY;QAEZ,KAAK,CACH,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,EAAE;YACzB,MAAM,EAAE,WAAW;YACnB,KAAK,EAAE;gBACL,KAAK,EAAE,iBAAiB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;gBACxC,MAAM,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI;gBACtB,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI;gBAClB,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;gBACxB,SAAS,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK;gBAC1B,OAAO,EAAE,IAAI,CAAC,QAAQ;gBACtB,OAAO,EAAE,IAAI,CAA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AI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACtC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;QAChC,CAAC;IACH,CAAC;IAKD,IAAI,aAAa;QACf,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACzB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACnD,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAMD,SAAS,CAAC,MAAW;QACnB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;CAaF","sourcesContent":["import * as TSU from \"@panyam/tsutils\";\nimport { AtomView, Embelishment, ElementShape } from \"./shapes\";\nimport { GridCell, GridCellView } from \"./grids\";\nimport { Cycle } from \"./cycle\";\nimport { Beat } from \"./beats\";\n\n/**\n * Abstract base class for views that represent beats in the notation.\n * BeatView provides the visual representation of a beat and implements the GridCellView\n * interface to support placement in a grid.\n */\nexport abstract class BeatView extends ElementShape<SVGGElement> implements GridCellView {\n /** Embellishments applied to this beat view */\n private _embelishments: Embelishment[];\n\n /** View for the atom contained in this beat (null if beat has only markers) */\n atomView: AtomView | null;\n\n /** Whether this view needs layout */\n needsLayout = true;\n\n /**\n * Creates a new BeatView.\n * @param cell The grid cell this beat view belongs to\n * @param beat The beat this view represents\n * @param rootElement The root SVG element to attach to\n * @param cycle The cycle this beat belongs to\n * @param config Optional configuration object\n */\n constructor(\n public readonly cell: GridCell,\n public readonly beat: Beat,\n public readonly rootElement: SVGGraphicsElement,\n public readonly cycle: Cycle,\n config?: any,\n ) {\n super(\n TSU.DOM.createSVGNode(\"g\", {\n parent: rootElement,\n attrs: {\n class: `beatView role_${beat.role.name}`,\n beatId: \"\" + beat.uuid,\n id: \"\" + beat.uuid,\n roleName: beat.role.name,\n beatIndex: \"\" + beat.index,\n gridRow: cell.rowIndex,\n gridCol: cell.colIndex,\n },\n }),\n );\n this.atomView = this.createAtomView();\n if (this.atomView) {\n this.atomView.refreshLayout();\n }\n }\n\n /**\n * Gets the embellishments for this beat view.\n */\n get embelishments(): Embelishment[] {\n if (!this._embelishments) {\n this._embelishments = this.createEmbelishments();\n }\n return this._embelishments;\n }\n\n /**\n * Sets the styles for this beat view.\n * @param config Style configuration object\n */\n setStyles(config: any): void {\n this.needsLayout = true;\n }\n\n /**\n * Creates the embellishments for this beat view.\n * @returns An array of embellishments\n */\n protected abstract createEmbelishments(): Embelishment[];\n\n /**\n * Creates the atom view for this beat view.\n * @returns The created atom view, or null if the beat has no renderable content\n */\n protected abstract createAtomView(): AtomView | null;\n}\n"]}
|
|
@@ -261,6 +261,19 @@ class SyllableView extends LeafAtomView {
|
|
|
261
261
|
return this.leafAtom;
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
+
class MarkerView extends LeafAtomView {
|
|
265
|
+
get glyphLabel() {
|
|
266
|
+
return this.marker.text;
|
|
267
|
+
}
|
|
268
|
+
get marker() {
|
|
269
|
+
return this.leafAtom;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
class UnknownAtomView extends LeafAtomView {
|
|
273
|
+
get glyphLabel() {
|
|
274
|
+
return `[?${this.leafAtom.TYPE}]`;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
264
277
|
export function createAtomView(parent, atom, litDefaultsToNote = false, groupViewScale = 1.0, depth = 0) {
|
|
265
278
|
let out;
|
|
266
279
|
switch (atom.TYPE) {
|
|
@@ -288,8 +301,12 @@ export function createAtomView(parent, atom, litDefaultsToNote = false, groupVie
|
|
|
288
301
|
out.defaultToNotes = litDefaultsToNote;
|
|
289
302
|
out.scaleFactor = groupViewScale;
|
|
290
303
|
break;
|
|
304
|
+
case AtomType.MARKER:
|
|
305
|
+
out = new MarkerView(atom);
|
|
306
|
+
break;
|
|
291
307
|
default:
|
|
292
|
-
|
|
308
|
+
console.warn(`Unknown atom type: ${atom.TYPE} - rendering placeholder`);
|
|
309
|
+
out = new UnknownAtomView(atom);
|
|
293
310
|
}
|
|
294
311
|
out.depth = depth;
|
|
295
312
|
out.createElements(parent);
|