@masterteam/components 0.0.208 → 0.0.210
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/fesm2022/masterteam-components-editor-field.mjs +2 -2
- package/fesm2022/masterteam-components-editor-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-entities.mjs +13 -3
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-formula.mjs +36 -2
- package/fesm2022/masterteam-components-formula.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-entities.d.ts +10 -1
|
@@ -1139,6 +1139,35 @@ const MONACO_ASSET_DIR = 'assets/monaco/vs';
|
|
|
1139
1139
|
* instance reuses a single load).
|
|
1140
1140
|
*/
|
|
1141
1141
|
let monacoLoadPromise = null;
|
|
1142
|
+
/**
|
|
1143
|
+
* Shared, body-level container for Monaco's overflow widgets (the suggest and
|
|
1144
|
+
* hover popups). Monaco renders those with `position: fixed`, which is meant to
|
|
1145
|
+
* resolve against the viewport — but a `transform` / `will-change: transform`
|
|
1146
|
+
* on ANY ancestor turns that ancestor into the containing block, so a popup
|
|
1147
|
+
* inside a transformed host lands at the wrong offset. This is exactly what
|
|
1148
|
+
* breaks the suggest dropdown inside a PrimeNG dialog/drawer (`.p-dialog` /
|
|
1149
|
+
* `.p-drawer` carry `transform: scale(1)`) and the foblex-flow canvas (`scale`).
|
|
1150
|
+
*
|
|
1151
|
+
* Pointing the editor's `overflowWidgetsDomNode` at a node appended straight to
|
|
1152
|
+
* <body> — which has no transformed ancestor — makes `position: fixed` resolve
|
|
1153
|
+
* against the viewport again, fixing every host at once instead of patching one
|
|
1154
|
+
* container type. Created once and reused by every editor instance (Monaco
|
|
1155
|
+
* appends and cleans up its own per-editor sub-nodes inside it), mirroring how
|
|
1156
|
+
* VS Code shares a single overflow container.
|
|
1157
|
+
*/
|
|
1158
|
+
let monacoOverflowWidgetsNode = null;
|
|
1159
|
+
function resolveOverflowWidgetsNode(doc) {
|
|
1160
|
+
if (monacoOverflowWidgetsNode?.isConnected) {
|
|
1161
|
+
return monacoOverflowWidgetsNode;
|
|
1162
|
+
}
|
|
1163
|
+
const node = doc.createElement('div');
|
|
1164
|
+
// `monaco-editor` lets Monaco's global, theme-driven suggest/hover CSS match;
|
|
1165
|
+
// `mt-formula-editor-overflow` carries our cosmetic tweaks + escape z-index.
|
|
1166
|
+
node.className = 'monaco-editor mt-formula-editor-overflow';
|
|
1167
|
+
doc.body.appendChild(node);
|
|
1168
|
+
monacoOverflowWidgetsNode = node;
|
|
1169
|
+
return node;
|
|
1170
|
+
}
|
|
1142
1171
|
/** Absolute URL to the copied Monaco `vs` folder, with no trailing slash. */
|
|
1143
1172
|
function resolveMonacoAssetBase(doc) {
|
|
1144
1173
|
return new URL(`${MONACO_ASSET_DIR}/`, doc.baseURI)
|
|
@@ -1413,6 +1442,11 @@ class FormulaEditorCode {
|
|
|
1413
1442
|
glyphMargin: false,
|
|
1414
1443
|
automaticLayout: true,
|
|
1415
1444
|
fixedOverflowWidgets: true,
|
|
1445
|
+
// Render suggest/hover popups in a body-level node so their
|
|
1446
|
+
// `position: fixed` resolves against the viewport, not a transformed
|
|
1447
|
+
// ancestor (PrimeNG dialog/drawer, foblex-flow canvas). See
|
|
1448
|
+
// resolveOverflowWidgetsNode above.
|
|
1449
|
+
overflowWidgetsDomNode: resolveOverflowWidgetsNode(this.document),
|
|
1416
1450
|
suggestOnTriggerCharacters: true,
|
|
1417
1451
|
quickSuggestions: { other: true, comments: false, strings: true },
|
|
1418
1452
|
renderLineHighlight: 'line',
|
|
@@ -1919,7 +1953,7 @@ class FormulaEditorCode {
|
|
|
1919
1953
|
useExisting: forwardRef(() => FormulaEditorCode),
|
|
1920
1954
|
multi: true,
|
|
1921
1955
|
},
|
|
1922
|
-
], viewQueries: [{ propertyName: "editorHost", first: true, predicate: ["editorHost"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n [class]=\"containerClasses()\"\r\n [class.opacity-60]=\"disabled()\"\r\n [class.pointer-events-none]=\"disabled()\"\r\n>\r\n <div #editorHost class=\"min-h-20 flex-1\"></div>\r\n\r\n @if (showPlaceholder()) {\r\n <div\r\n class=\"mt-formula-editor-code__placeholder text-sm italic text-surface-400 dark:text-surface-500\"\r\n >\r\n {{ placeholder() }}\r\n </div>\r\n }\r\n</div>\r\n", styles: [".mt-formula-editor-code{position:relative;--mt-formula-editor-code-gutter: 3.25rem;--mt-formula-editor-code-placeholder-top: .25rem}.mt-formula-editor-code__placeholder{position:absolute;top:var(--mt-formula-editor-code-placeholder-top);left:var(--mt-formula-editor-code-gutter);pointer-events:none;z-index:2;white-space:nowrap}.mt-formula-editor-code .monaco-editor .overflow-guard{overflow:visible}.mt-formula-editor-
|
|
1956
|
+
], viewQueries: [{ propertyName: "editorHost", first: true, predicate: ["editorHost"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\r\n [class]=\"containerClasses()\"\r\n [class.opacity-60]=\"disabled()\"\r\n [class.pointer-events-none]=\"disabled()\"\r\n>\r\n <div #editorHost class=\"min-h-20 flex-1\"></div>\r\n\r\n @if (showPlaceholder()) {\r\n <div\r\n class=\"mt-formula-editor-code__placeholder text-sm italic text-surface-400 dark:text-surface-500\"\r\n >\r\n {{ placeholder() }}\r\n </div>\r\n }\r\n</div>\r\n", styles: [".mt-formula-editor-code{position:relative;--mt-formula-editor-code-gutter: 3.25rem;--mt-formula-editor-code-placeholder-top: .25rem}.mt-formula-editor-code__placeholder{position:absolute;top:var(--mt-formula-editor-code-placeholder-top);left:var(--mt-formula-editor-code-gutter);pointer-events:none;z-index:2;white-space:nowrap}.mt-formula-editor-code .monaco-editor .overflow-guard{overflow:visible}.mt-formula-editor-overflow{position:fixed;inset:0 auto auto 0;width:0;height:0;z-index:100000;transform:none}.mt-formula-editor-code .monaco-editor .cursor{transition:opacity .1s ease-in-out}.mt-formula-editor-code .monaco-editor .selected-text{border-radius:0}.mt-formula-editor-code .monaco-editor .bracket-match{border-radius:2px}.mt-formula-editor-code .monaco-editor .view-overlays .current-line{border:none}.mt-formula-editor-code .monaco-editor .monaco-scrollable-element>.scrollbar>.slider{border-radius:0}.mt-formula-editor-code .monaco-editor .suggest-widget,.mt-formula-editor-overflow .suggest-widget{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029,0 0 0 1px #0000000a}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row,.mt-formula-editor-overflow .suggest-widget .monaco-list-row{padding:0 4px}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row.focused,.mt-formula-editor-overflow .suggest-widget .monaco-list-row.focused{border-radius:3px}.mt-formula-editor-code .monaco-editor .monaco-hover,.mt-formula-editor-overflow .monaco-hover{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1923
1957
|
}
|
|
1924
1958
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: FormulaEditorCode, decorators: [{
|
|
1925
1959
|
type: Component,
|
|
@@ -1931,7 +1965,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1931
1965
|
useExisting: forwardRef(() => FormulaEditorCode),
|
|
1932
1966
|
multi: true,
|
|
1933
1967
|
},
|
|
1934
|
-
], template: "<div\r\n [class]=\"containerClasses()\"\r\n [class.opacity-60]=\"disabled()\"\r\n [class.pointer-events-none]=\"disabled()\"\r\n>\r\n <div #editorHost class=\"min-h-20 flex-1\"></div>\r\n\r\n @if (showPlaceholder()) {\r\n <div\r\n class=\"mt-formula-editor-code__placeholder text-sm italic text-surface-400 dark:text-surface-500\"\r\n >\r\n {{ placeholder() }}\r\n </div>\r\n }\r\n</div>\r\n", styles: [".mt-formula-editor-code{position:relative;--mt-formula-editor-code-gutter: 3.25rem;--mt-formula-editor-code-placeholder-top: .25rem}.mt-formula-editor-code__placeholder{position:absolute;top:var(--mt-formula-editor-code-placeholder-top);left:var(--mt-formula-editor-code-gutter);pointer-events:none;z-index:2;white-space:nowrap}.mt-formula-editor-code .monaco-editor .overflow-guard{overflow:visible}.mt-formula-editor-
|
|
1968
|
+
], template: "<div\r\n [class]=\"containerClasses()\"\r\n [class.opacity-60]=\"disabled()\"\r\n [class.pointer-events-none]=\"disabled()\"\r\n>\r\n <div #editorHost class=\"min-h-20 flex-1\"></div>\r\n\r\n @if (showPlaceholder()) {\r\n <div\r\n class=\"mt-formula-editor-code__placeholder text-sm italic text-surface-400 dark:text-surface-500\"\r\n >\r\n {{ placeholder() }}\r\n </div>\r\n }\r\n</div>\r\n", styles: [".mt-formula-editor-code{position:relative;--mt-formula-editor-code-gutter: 3.25rem;--mt-formula-editor-code-placeholder-top: .25rem}.mt-formula-editor-code__placeholder{position:absolute;top:var(--mt-formula-editor-code-placeholder-top);left:var(--mt-formula-editor-code-gutter);pointer-events:none;z-index:2;white-space:nowrap}.mt-formula-editor-code .monaco-editor .overflow-guard{overflow:visible}.mt-formula-editor-overflow{position:fixed;inset:0 auto auto 0;width:0;height:0;z-index:100000;transform:none}.mt-formula-editor-code .monaco-editor .cursor{transition:opacity .1s ease-in-out}.mt-formula-editor-code .monaco-editor .selected-text{border-radius:0}.mt-formula-editor-code .monaco-editor .bracket-match{border-radius:2px}.mt-formula-editor-code .monaco-editor .view-overlays .current-line{border:none}.mt-formula-editor-code .monaco-editor .monaco-scrollable-element>.scrollbar>.slider{border-radius:0}.mt-formula-editor-code .monaco-editor .suggest-widget,.mt-formula-editor-overflow .suggest-widget{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029,0 0 0 1px #0000000a}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row,.mt-formula-editor-overflow .suggest-widget .monaco-list-row{padding:0 4px}.mt-formula-editor-code .monaco-editor .suggest-widget .monaco-list-row.focused,.mt-formula-editor-overflow .suggest-widget .monaco-list-row.focused{border-radius:3px}.mt-formula-editor-code .monaco-editor .monaco-hover,.mt-formula-editor-overflow .monaco-hover{z-index:2000;border-radius:3px;box-shadow:0 2px 8px #00000029}\n"] }]
|
|
1935
1969
|
}], ctorParameters: () => [], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], initialFormula: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialFormula", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], language: [{ type: i0.Input, args: [{ isSignal: true, alias: "language", required: false }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], borderless: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderless", required: false }] }], autocompleteProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocompleteProvider", required: false }] }], autocompleteDebounceMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocompleteDebounceMs", required: false }] }], formulaChange: [{ type: i0.Output, args: ["formulaChange"] }], onBlur: [{ type: i0.Output, args: ["onBlur"] }], onFocus: [{ type: i0.Output, args: ["onFocus"] }], editorHost: [{ type: i0.ViewChild, args: ['editorHost', { isSignal: true }] }] } });
|
|
1936
1970
|
|
|
1937
1971
|
/**
|