@bitcobblers/wod-wiki-ui 0.44.2160 → 0.45.2166
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/dist/{chunk-7OSBFQY7.mjs → chunk-QCWASNQO.mjs} +187 -76
- package/dist/chunk-QCWASNQO.mjs.map +1 -0
- package/dist/extensions/index.cjs +184 -67
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.d.cts +3 -1
- package/dist/extensions/index.d.ts +3 -1
- package/dist/extensions/index.mjs +1 -1
- package/dist/{index-CNVZ516f.d.cts → index-BPh_dUN3.d.cts} +56 -4
- package/dist/{index-CNVZ516f.d.ts → index-BPh_dUN3.d.ts} +56 -4
- package/dist/index.cjs +194 -79
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -14
- package/dist/index.d.ts +16 -14
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/dist/chunk-7OSBFQY7.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -2214,7 +2214,7 @@ function EditorDialog({
|
|
|
2214
2214
|
const handleKeyDown = (event) => {
|
|
2215
2215
|
if (event.key === "Escape") {
|
|
2216
2216
|
event.stopPropagation();
|
|
2217
|
-
onClose();
|
|
2217
|
+
if (!event.defaultPrevented) onClose();
|
|
2218
2218
|
return;
|
|
2219
2219
|
}
|
|
2220
2220
|
if (event.key !== "Tab") return;
|
|
@@ -2370,7 +2370,11 @@ var TARGET_OPTIONS = wodWikiWql.WQL_FIND_TARGETS.map((t) => ({
|
|
|
2370
2370
|
effort: "Find registered movements and benchmarks",
|
|
2371
2371
|
session: "Find completed workout sessions",
|
|
2372
2372
|
segment: "Cross-workout segment table",
|
|
2373
|
-
event: "Telemetry events table"
|
|
2373
|
+
event: "Telemetry events table",
|
|
2374
|
+
notebook: "Find notebooks \u2014 every notebook, narrowed with notebook:",
|
|
2375
|
+
page: "Find page placements \u2014 notes placed on pages, narrowed with page:",
|
|
2376
|
+
tag: "Find tags \u2014 labels, types, and what they contribute",
|
|
2377
|
+
equipment: "Find equipment notes \u2014 narrowed with equipment: or tags:"
|
|
2374
2378
|
}[t]
|
|
2375
2379
|
}));
|
|
2376
2380
|
var SOURCE_OPTIONS = wodWikiWql.WQL_SOURCE_VALUES.map((s) => ({
|
|
@@ -2378,7 +2382,7 @@ var SOURCE_OPTIONS = wodWikiWql.WQL_SOURCE_VALUES.map((s) => ({
|
|
|
2378
2382
|
label: s.charAt(0).toUpperCase() + s.slice(1),
|
|
2379
2383
|
description: {
|
|
2380
2384
|
journal: "Daily journal notes",
|
|
2381
|
-
|
|
2385
|
+
notebooks: "Notebook notes",
|
|
2382
2386
|
guides: "Static guide pages",
|
|
2383
2387
|
playground: "Playground scratch pages",
|
|
2384
2388
|
dashboards: "Dashboard notes",
|
|
@@ -2418,9 +2422,9 @@ var CLAUSE_META = {
|
|
|
2418
2422
|
target: { label: "Find", inputType: "select", placeholder: "note, block, effort\u2026", placeholderText: ": [target]", icon: "\u{1F3AF}", description: "What to find \u2014 singular", prefix: ":" },
|
|
2419
2423
|
source: { label: "Where stored", inputType: "select", placeholder: "journal, notebooks\u2026", placeholderText: "source: [scope]", icon: "\u{1F310}", description: "Storage scope \u2014 all sources means no scope", prefix: "source:" },
|
|
2420
2424
|
text: { label: "Contains", inputType: "freetext", placeholder: "Text query...", placeholderText: "text: [query]", icon: "\u{1F50D}", description: "Raw text substring search", prefix: "text:" },
|
|
2421
|
-
catalog: { label: "Catalog", inputType: "select", placeholder: "crossfit-games, hyrox...", placeholderText: "catalog: [directory-id]", icon: "\u{1F4D3}", description: "Filter by catalog directory id, e.g. crossfit-games", prefix: "catalog:" },
|
|
2422
2425
|
notebook: { label: "Notebook", inputType: "select", placeholder: "Pick notebook...", placeholderText: "notebook: [id]", icon: "\u{1F4D3}", description: "Filter by canonical notebook container id, e.g. notebook/journal, notebook/playground, notebook/guides", prefix: "notebook:" },
|
|
2423
2426
|
tag: { label: "Tag", inputType: "select", placeholder: "Pick tag...", placeholderText: "tags: [tag]", icon: "\u{1F3F7}", description: "Filter by note/workout tags", prefix: "tags:" },
|
|
2427
|
+
contributes: { label: "Contributes", inputType: "select", placeholder: "metric, tag, function\u2026", placeholderText: "contributes: [kind]", icon: "\u2747", description: "On :tag \u2014 what a tag contributes (metric, tag:<slug>, function:<name>) \u2014 never a label filter", prefix: "contributes:" },
|
|
2424
2428
|
effort: { label: "Effort", inputType: "select", placeholder: "Pick effort...", placeholderText: "effort: [movement]", icon: "\u{1F4AA}", description: "Filter by movement/workout", prefix: "effort:" },
|
|
2425
2429
|
domain: { label: "Domain", inputType: "select", placeholder: "crossfit, parkour, swimming\u2026", placeholderText: "domain: [discipline]", icon: "\u{1F310}", description: "Filter by sport/training domain", prefix: "domain:" },
|
|
2426
2430
|
format: { label: "Format", inputType: "select", placeholder: "for-time, amrap, emom\u2026", placeholderText: "format: [shape]", icon: "\u23F1", description: "Filter by session time structure", prefix: "format:" },
|
|
@@ -2441,7 +2445,7 @@ var CLAUSE_META = {
|
|
|
2441
2445
|
result: { label: "Session", inputType: "freetext", placeholder: "result id\u2026", placeholderText: "result: [id]", icon: "\u{1F3C1}", description: "Scope to one workout session", prefix: "result:" },
|
|
2442
2446
|
block: { label: "Block", inputType: "freetext", placeholder: "block content id\u2026", placeholderText: "block: [contentId]", icon: "\u{1F9F1}", description: "Scope to all versions of a block", prefix: "block:" },
|
|
2443
2447
|
note: { label: "Note", inputType: "freetext", placeholder: "note id\u2026", placeholderText: "note: [id]", icon: "\u{1F4D3}", description: "Scope to one note", prefix: "note:" },
|
|
2444
|
-
page: { label: "Page", inputType: "select", placeholder: "
|
|
2448
|
+
page: { label: "Page", inputType: "select", placeholder: "slug, date, true\u2026", placeholderText: "page: [slug|date]", icon: "\u{1F4C4}", description: "On :page \u2014 the page slug or YYYY-MM-DD date; on :note \u2014 page-ness (true/false)", prefix: "page:" },
|
|
2445
2449
|
plane: { label: "Output Plane", inputType: "select", placeholder: "segment, load, event\u2026", placeholderText: "plane: [type]", icon: "\u{1F4CB}", description: "Output-statement plane on :session", prefix: "plane:" },
|
|
2446
2450
|
pipes: { label: "Pipes", inputType: "freetext", placeholder: "| order by date | limit 10", placeholderText: "| select | order | limit", icon: "\u21E5", description: "Presentation pipes \u2014 select/order/limit/offset" }
|
|
2447
2451
|
};
|
|
@@ -2708,8 +2712,8 @@ function InlineClauseEditor({
|
|
|
2708
2712
|
}
|
|
2709
2713
|
var MULTI_VALUE_TYPES = {
|
|
2710
2714
|
tag: true,
|
|
2711
|
-
catalog: true,
|
|
2712
2715
|
notebook: true,
|
|
2716
|
+
contributes: true,
|
|
2713
2717
|
effort: true,
|
|
2714
2718
|
domain: true,
|
|
2715
2719
|
format: true,
|
|
@@ -2748,13 +2752,11 @@ function tagsFromStaticBlocks(blocks) {
|
|
|
2748
2752
|
}
|
|
2749
2753
|
return Array.from(set).sort((a, b) => a.localeCompare(b));
|
|
2750
2754
|
}
|
|
2751
|
-
function
|
|
2755
|
+
function notebookSlugsFromBlocks(blocks) {
|
|
2752
2756
|
const set = /* @__PURE__ */ new Set();
|
|
2753
2757
|
for (const b of blocks) {
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
if (catalog) set.add(catalog);
|
|
2757
|
-
}
|
|
2758
|
+
const slug = wodWikiWql.notebookSlugOfSourceId(b.sourceId);
|
|
2759
|
+
if (slug) set.add(slug);
|
|
2758
2760
|
}
|
|
2759
2761
|
return Array.from(set).sort((a, b) => a.localeCompare(b));
|
|
2760
2762
|
}
|
|
@@ -2795,12 +2797,6 @@ var builtinBindings = {
|
|
|
2795
2797
|
open: false,
|
|
2796
2798
|
emptyText: "No disciplines available"
|
|
2797
2799
|
},
|
|
2798
|
-
catalog: {
|
|
2799
|
-
load: async () => [],
|
|
2800
|
-
cache: "static",
|
|
2801
|
-
open: false,
|
|
2802
|
-
emptyText: "No catalogs in the static corpus"
|
|
2803
|
-
},
|
|
2804
2800
|
notebook: {
|
|
2805
2801
|
load: async () => [],
|
|
2806
2802
|
cache: "static",
|
|
@@ -2818,6 +2814,14 @@ var builtinBindings = {
|
|
|
2818
2814
|
cache: "static",
|
|
2819
2815
|
open: false,
|
|
2820
2816
|
emptyText: "No indexed block types yet"
|
|
2817
|
+
},
|
|
2818
|
+
// Tag-plane contribution kinds (ticket 08) — an open slot: qualifiers like
|
|
2819
|
+
// `metric:rpe` or `function:calc.e1rm` are typed, never listed as labels.
|
|
2820
|
+
contributes: {
|
|
2821
|
+
load: async () => canonicalSuggestionItems(["metric", "tag", "function"]),
|
|
2822
|
+
cache: "static",
|
|
2823
|
+
open: true,
|
|
2824
|
+
emptyText: "metric, tag, or function"
|
|
2821
2825
|
}
|
|
2822
2826
|
};
|
|
2823
2827
|
var SUGGESTION_BINDINGS = { ...builtinBindings };
|
|
@@ -3355,6 +3359,70 @@ function resolveQueryDraft(query, pendingText = "") {
|
|
|
3355
3359
|
else filters[index] = filter;
|
|
3356
3360
|
return emit({ ...base.ast, filters });
|
|
3357
3361
|
}
|
|
3362
|
+
var autocompleteTooltipTheme = view.EditorView.theme({
|
|
3363
|
+
".cm-tooltip": {
|
|
3364
|
+
backgroundColor: "hsl(var(--popover))",
|
|
3365
|
+
color: "hsl(var(--popover-foreground))",
|
|
3366
|
+
border: "1px solid hsl(var(--border))",
|
|
3367
|
+
borderRadius: "var(--radius-md)",
|
|
3368
|
+
// Tailwind shadow-md (no --shadow-* token exists yet).
|
|
3369
|
+
boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
3370
|
+
fontFamily: "var(--font-sans, Inter, system-ui, sans-serif)",
|
|
3371
|
+
fontSize: "14px",
|
|
3372
|
+
zIndex: "40"
|
|
3373
|
+
},
|
|
3374
|
+
".cm-tooltip-autocomplete": {
|
|
3375
|
+
overflow: "hidden",
|
|
3376
|
+
// Viewport clamps keep the popover usable on narrow/mobile screens.
|
|
3377
|
+
minWidth: "min(18rem, calc(100vw - 2rem))",
|
|
3378
|
+
maxWidth: "calc(100vw - 2rem)"
|
|
3379
|
+
},
|
|
3380
|
+
".cm-tooltip-autocomplete > ul": {
|
|
3381
|
+
padding: "4px",
|
|
3382
|
+
maxHeight: "min(45svh, 20rem)",
|
|
3383
|
+
overscrollBehavior: "contain",
|
|
3384
|
+
fontFamily: "inherit",
|
|
3385
|
+
fontSize: "inherit"
|
|
3386
|
+
},
|
|
3387
|
+
".cm-tooltip-autocomplete > ul > li": {
|
|
3388
|
+
display: "flex",
|
|
3389
|
+
alignItems: "center",
|
|
3390
|
+
gap: "8px",
|
|
3391
|
+
minHeight: "40px",
|
|
3392
|
+
padding: "8px 10px",
|
|
3393
|
+
borderRadius: "var(--radius-sm)",
|
|
3394
|
+
lineHeight: "20px"
|
|
3395
|
+
},
|
|
3396
|
+
".cm-tooltip-autocomplete > ul > li:hover": {
|
|
3397
|
+
backgroundColor: "hsl(var(--muted) / 0.6)"
|
|
3398
|
+
},
|
|
3399
|
+
'.cm-tooltip-autocomplete > ul > li[aria-selected="true"]': {
|
|
3400
|
+
backgroundColor: "hsl(var(--primary) / 0.15)",
|
|
3401
|
+
fontWeight: "600"
|
|
3402
|
+
},
|
|
3403
|
+
".cm-completionLabel": {
|
|
3404
|
+
fontFamily: "var(--font-mono, ui-monospace, SFMono-Regular, monospace)",
|
|
3405
|
+
fontWeight: "500",
|
|
3406
|
+
overflow: "hidden",
|
|
3407
|
+
textOverflow: "ellipsis"
|
|
3408
|
+
},
|
|
3409
|
+
".cm-completionMatchedText": {
|
|
3410
|
+
textDecoration: "none",
|
|
3411
|
+
fontWeight: "700",
|
|
3412
|
+
color: "hsl(var(--primary))"
|
|
3413
|
+
},
|
|
3414
|
+
".cm-completionDetail": {
|
|
3415
|
+
marginLeft: "auto",
|
|
3416
|
+
paddingLeft: "12px",
|
|
3417
|
+
fontFamily: "var(--font-sans, Inter, system-ui, sans-serif)",
|
|
3418
|
+
fontSize: "12px",
|
|
3419
|
+
fontStyle: "normal",
|
|
3420
|
+
color: "hsl(var(--muted-foreground))"
|
|
3421
|
+
},
|
|
3422
|
+
"@media (pointer: coarse)": {
|
|
3423
|
+
".cm-tooltip-autocomplete > ul > li": { minHeight: "48px" }
|
|
3424
|
+
}
|
|
3425
|
+
});
|
|
3358
3426
|
var completionIcons = {
|
|
3359
3427
|
search: server.renderToStaticMarkup(React2.createElement(lucideReact.Search, { size: 16 })),
|
|
3360
3428
|
metric: server.renderToStaticMarkup(React2.createElement(lucideReact.ChartNoAxesCombined, { size: 16 })),
|
|
@@ -3552,38 +3620,9 @@ function WqlTextEditor({ value, onChange, onSubmit, onEscape, placeholder, autoF
|
|
|
3552
3620
|
'.cm-line span[class*="tok-"]:hover, .cm-line span[class^="tok-"]:hover': { fontWeight: "700", textShadow: "0 0 0.5px currentColor", cursor: "pointer" },
|
|
3553
3621
|
".cm-scroller": { overflow: "auto" },
|
|
3554
3622
|
".cm-placeholder": { color: "hsl(var(--muted-foreground))" },
|
|
3555
|
-
".
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
border: "1px solid hsl(var(--border))",
|
|
3559
|
-
borderRadius: "12px",
|
|
3560
|
-
boxShadow: "0 8px 24px rgb(0 0 0 / 0.16)",
|
|
3561
|
-
fontFamily: "var(--font-sans, Inter, system-ui, sans-serif)",
|
|
3562
|
-
fontSize: "14px"
|
|
3563
|
-
},
|
|
3564
|
-
".cm-tooltip-autocomplete": { overflow: "hidden", minWidth: "min(18rem, calc(100vw - 2rem))", maxWidth: "calc(100vw - 2rem)" },
|
|
3565
|
-
".cm-tooltip-autocomplete > ul": { padding: "4px", maxHeight: "min(20rem, 45vh)", overscrollBehavior: "contain" },
|
|
3566
|
-
".cm-tooltip-autocomplete > ul > li": {
|
|
3567
|
-
display: "flex",
|
|
3568
|
-
alignItems: "center",
|
|
3569
|
-
gap: "8px",
|
|
3570
|
-
minHeight: "40px",
|
|
3571
|
-
padding: "8px 10px",
|
|
3572
|
-
borderRadius: "8px",
|
|
3573
|
-
lineHeight: "20px"
|
|
3574
|
-
},
|
|
3575
|
-
".cm-tooltip-autocomplete > ul > li:hover": { backgroundColor: "hsl(var(--muted))" },
|
|
3576
|
-
".cm-tooltip-autocomplete > ul > li[aria-selected]": {
|
|
3577
|
-
backgroundColor: "hsl(var(--accent))",
|
|
3578
|
-
color: "hsl(var(--accent-foreground))",
|
|
3579
|
-
boxShadow: "inset 2px 0 hsl(var(--primary))"
|
|
3580
|
-
},
|
|
3581
|
-
".wql-completion-icon": { display: "inline-flex", flexShrink: "0", color: "hsl(var(--primary))" },
|
|
3582
|
-
".cm-completionLabel": { fontWeight: "500", overflow: "hidden", textOverflow: "ellipsis" },
|
|
3583
|
-
".cm-completionMatchedText": { textDecoration: "none", fontWeight: "700", color: "hsl(var(--primary))" },
|
|
3584
|
-
".cm-completionDetail": { marginLeft: "auto", paddingLeft: "12px", fontSize: "12px", fontStyle: "normal", color: "hsl(var(--muted-foreground))" },
|
|
3585
|
-
"@media (pointer: coarse)": { ".cm-tooltip-autocomplete > ul > li": { minHeight: "48px" } }
|
|
3586
|
-
})
|
|
3623
|
+
".wql-completion-icon": { display: "inline-flex", flexShrink: "0", color: "hsl(var(--primary))" }
|
|
3624
|
+
}),
|
|
3625
|
+
autocompleteTooltipTheme
|
|
3587
3626
|
]
|
|
3588
3627
|
})
|
|
3589
3628
|
});
|
|
@@ -4361,8 +4400,8 @@ function AnalyticsChart({
|
|
|
4361
4400
|
function containerPageHref(container) {
|
|
4362
4401
|
if (!container || container.kind !== "page") return void 0;
|
|
4363
4402
|
const { slug, date } = container;
|
|
4364
|
-
if (slug) return `/
|
|
4365
|
-
if (date) return `/
|
|
4403
|
+
if (slug) return `/page/${encodeURIComponent(slug)}`;
|
|
4404
|
+
if (date) return `/day/${encodeURIComponent(date)}`;
|
|
4366
4405
|
return void 0;
|
|
4367
4406
|
}
|
|
4368
4407
|
function FindResultList({
|
|
@@ -5027,7 +5066,7 @@ var sectionIdentityHistory = commands.invertedEffects.of((tr) => {
|
|
|
5027
5066
|
return value && tr.docChanged ? [restoreHistoryIdentity.of({ rawContent: value.rawContent, blocks: toEditorBlocks(value) })] : [];
|
|
5028
5067
|
});
|
|
5029
5068
|
function sectionAtPos(state, pos) {
|
|
5030
|
-
return state.field(sectionField)
|
|
5069
|
+
return state.field(sectionField, false)?.sections.find((section) => pos >= section.from && pos <= section.to) ?? null;
|
|
5031
5070
|
}
|
|
5032
5071
|
function activeCursorSection(state) {
|
|
5033
5072
|
return sectionAtPos(state, state.selection.main.head);
|
|
@@ -5122,6 +5161,8 @@ function fenceCompletion(context) {
|
|
|
5122
5161
|
}
|
|
5123
5162
|
function wrapInTimeFence(view) {
|
|
5124
5163
|
if (view.state.readOnly) return false;
|
|
5164
|
+
const section = activeCursorSection(view.state);
|
|
5165
|
+
if (section && section.type !== "markdown") return false;
|
|
5125
5166
|
const { from, to } = view.state.selection.main;
|
|
5126
5167
|
const selected = view.state.doc.sliceString(from, to);
|
|
5127
5168
|
if (!selected) {
|
|
@@ -5145,6 +5186,8 @@ ${selected}
|
|
|
5145
5186
|
function handleFenceAutoWrap(event, view) {
|
|
5146
5187
|
if (view.state.readOnly) return false;
|
|
5147
5188
|
if (event.data !== "`") return false;
|
|
5189
|
+
const section = activeCursorSection(view.state);
|
|
5190
|
+
if (section && section.type !== "markdown") return false;
|
|
5148
5191
|
const { from, to } = view.state.selection.main;
|
|
5149
5192
|
if (from === to) return false;
|
|
5150
5193
|
const selected = view.state.doc.sliceString(from, to);
|
|
@@ -5169,30 +5212,86 @@ var wodEditorKeymap = view.keymap.of([
|
|
|
5169
5212
|
run: wrapInTimeFence
|
|
5170
5213
|
}
|
|
5171
5214
|
]);
|
|
5172
|
-
var customCompletionSources =
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5215
|
+
var customCompletionSources = state.Facet.define({
|
|
5216
|
+
combine: (sources) => sources
|
|
5217
|
+
});
|
|
5218
|
+
var nestedCompletionOptions = state.Facet.define({
|
|
5219
|
+
combine: (values2) => values2[values2.length - 1]
|
|
5220
|
+
});
|
|
5221
|
+
var sharedWqlSource;
|
|
5222
|
+
var nestedWqlSources = /* @__PURE__ */ new WeakMap();
|
|
5223
|
+
function nestedWqlSource(options) {
|
|
5224
|
+
if (!options) return sharedWqlSource ??= wodWikiWql.wqlCompletionSource({});
|
|
5225
|
+
let source = nestedWqlSources.get(options);
|
|
5226
|
+
if (!source) {
|
|
5227
|
+
source = wodWikiWql.wqlCompletionSource(options);
|
|
5228
|
+
nestedWqlSources.set(options, source);
|
|
5229
|
+
}
|
|
5230
|
+
return source;
|
|
5231
|
+
}
|
|
5232
|
+
var sharedWbPerSport;
|
|
5233
|
+
var nestedWbSources = /* @__PURE__ */ new WeakMap();
|
|
5234
|
+
function nestedWhiteboardScriptSource(options, sport) {
|
|
5235
|
+
let perSport;
|
|
5236
|
+
if (!options) perSport = sharedWbPerSport ??= /* @__PURE__ */ new Map();
|
|
5237
|
+
else {
|
|
5238
|
+
perSport = nestedWbSources.get(options) ?? /* @__PURE__ */ new Map();
|
|
5239
|
+
nestedWbSources.set(options, perSport);
|
|
5240
|
+
}
|
|
5241
|
+
const key = sport ?? "";
|
|
5242
|
+
let source = perSport.get(key);
|
|
5243
|
+
if (!source) {
|
|
5244
|
+
source = wodWikiLang.whiteboardScriptCompletionSource({ ...options ?? {}, ...sport ? { sport } : {} });
|
|
5245
|
+
perSport.set(key, source);
|
|
5246
|
+
}
|
|
5247
|
+
return source;
|
|
5248
|
+
}
|
|
5249
|
+
function wqlFenceAt(state, pos) {
|
|
5250
|
+
return /^`{3,}wql\b/i.test(state.doc.lineAt(pos).text.trim());
|
|
5251
|
+
}
|
|
5252
|
+
function nestedCompletion(context) {
|
|
5253
|
+
const section = sectionAtPos(context.state, context.pos);
|
|
5254
|
+
const { contentFrom, contentTo } = section ?? {};
|
|
5255
|
+
if (!section || contentFrom === void 0 || contentTo === void 0) return null;
|
|
5256
|
+
const whiteboard = section.type === "time" || section.type === "log";
|
|
5257
|
+
const query = section.type === "query" || wqlFenceAt(context.state, section.from);
|
|
5258
|
+
if (!whiteboard && !query) return null;
|
|
5259
|
+
if (context.pos < contentFrom || context.pos > contentTo) return null;
|
|
5260
|
+
const { state: state$1 } = context;
|
|
5261
|
+
const selection2 = state$1.selection.main;
|
|
5262
|
+
const selFrom = Math.min(Math.max(selection2.from, contentFrom), contentTo);
|
|
5263
|
+
const selTo = Math.min(Math.max(selection2.to, contentFrom), contentTo);
|
|
5264
|
+
const subState = state.EditorState.create({
|
|
5265
|
+
doc: state$1.doc.sliceString(contentFrom, contentTo),
|
|
5266
|
+
selection: state.EditorSelection.range(selFrom - contentFrom, selTo - contentFrom),
|
|
5267
|
+
// Slot detection may read the Lezer tree — parse the body with its
|
|
5268
|
+
// dialect language, exactly as a standalone editor's state would have it.
|
|
5269
|
+
extensions: whiteboard ? wodWikiLang.whiteboardScriptLanguage : [wodWikiWql.wqlLanguage]
|
|
5270
|
+
});
|
|
5271
|
+
const source = whiteboard ? nestedWhiteboardScriptSource(state$1.facet(nestedCompletionOptions)?.whiteboardScript, section.sport) : nestedWqlSource(state$1.facet(nestedCompletionOptions)?.wql);
|
|
5272
|
+
const result = source(
|
|
5273
|
+
new autocomplete.CompletionContext(subState, context.pos - contentFrom, context.explicit)
|
|
5274
|
+
);
|
|
5275
|
+
const rebase = (resolved) => resolved && {
|
|
5276
|
+
...resolved,
|
|
5277
|
+
from: contentFrom + resolved.from,
|
|
5278
|
+
...resolved.to !== void 0 ? { to: contentFrom + resolved.to } : {}
|
|
5279
|
+
};
|
|
5280
|
+
return result instanceof Promise ? result.then(rebase) : rebase(result);
|
|
5177
5281
|
}
|
|
5178
|
-
function
|
|
5179
|
-
const
|
|
5180
|
-
|
|
5181
|
-
|
|
5282
|
+
async function wodCompletionSource(context) {
|
|
5283
|
+
for (const source of context.state.facet(customCompletionSources)) {
|
|
5284
|
+
const result = await source(context);
|
|
5285
|
+
if (result) return result;
|
|
5182
5286
|
}
|
|
5287
|
+
return fenceCompletion(context) ?? nestedCompletion(context);
|
|
5183
5288
|
}
|
|
5184
5289
|
var wodAutocompletion = autocomplete.autocompletion({
|
|
5185
5290
|
interactionDelay: 0,
|
|
5186
5291
|
activateOnCompletion: (completion) => completion.type === "property" && typeof completion.apply === "string" && completion.apply.endsWith(":\n - "),
|
|
5187
5292
|
override: [
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
for (const source of customCompletionSources) {
|
|
5191
|
-
const res = await source(context);
|
|
5192
|
-
if (res) return res;
|
|
5193
|
-
}
|
|
5194
|
-
return null;
|
|
5195
|
-
}
|
|
5293
|
+
// Explicit provider order — see wodCompletionSource.
|
|
5294
|
+
wodCompletionSource
|
|
5196
5295
|
]
|
|
5197
5296
|
});
|
|
5198
5297
|
var SectionGeometryPlugin = class {
|
|
@@ -13488,6 +13587,7 @@ function editorPreset(optionsOrDialect = "markdown") {
|
|
|
13488
13587
|
onResultSaved,
|
|
13489
13588
|
catalog,
|
|
13490
13589
|
tagTypeValues,
|
|
13590
|
+
whiteboardScript: whiteboardScriptCompletion,
|
|
13491
13591
|
extensions: extraExtensions = []
|
|
13492
13592
|
} = options;
|
|
13493
13593
|
const extensions = [
|
|
@@ -13507,6 +13607,8 @@ function editorPreset(optionsOrDialect = "markdown") {
|
|
|
13507
13607
|
commands.indentWithTab
|
|
13508
13608
|
]),
|
|
13509
13609
|
editorTheme(isDark),
|
|
13610
|
+
// One token-based autocomplete tooltip theme for every dialect.
|
|
13611
|
+
autocompleteTooltipTheme,
|
|
13510
13612
|
lineIdsExtension,
|
|
13511
13613
|
smartIncrement
|
|
13512
13614
|
];
|
|
@@ -13521,10 +13623,18 @@ function editorPreset(optionsOrDialect = "markdown") {
|
|
|
13521
13623
|
extensions.push(wodWikiWql.wql(completionOptions));
|
|
13522
13624
|
} else if (dialect === "wod" || dialect === "whiteboard" || dialect === "time") {
|
|
13523
13625
|
extensions.push(
|
|
13524
|
-
wodWikiLang.whiteboardScript(),
|
|
13626
|
+
wodWikiLang.whiteboardScript(whiteboardScriptCompletion),
|
|
13525
13627
|
wodLinter
|
|
13526
13628
|
);
|
|
13527
13629
|
} else {
|
|
13630
|
+
const nestedWql = {
|
|
13631
|
+
...catalog ? { catalog } : {},
|
|
13632
|
+
...tagTypeValues ? { tagTypeValues } : {}
|
|
13633
|
+
};
|
|
13634
|
+
const nestedOptions = {
|
|
13635
|
+
...Object.keys(nestedWql).length ? { wql: nestedWql } : {},
|
|
13636
|
+
...whiteboardScriptCompletion ? { whiteboardScript: whiteboardScriptCompletion } : {}
|
|
13637
|
+
};
|
|
13528
13638
|
extensions.push(
|
|
13529
13639
|
markdown({ codeLanguages: resolveCodeLanguage }),
|
|
13530
13640
|
sectionField,
|
|
@@ -13534,6 +13644,7 @@ function editorPreset(optionsOrDialect = "markdown") {
|
|
|
13534
13644
|
wodAutocompletion,
|
|
13535
13645
|
wodEditorKeymap,
|
|
13536
13646
|
wodAutoWrap,
|
|
13647
|
+
...Object.keys(nestedOptions).length ? [nestedCompletionOptions.of(nestedOptions)] : [],
|
|
13537
13648
|
linkOpen,
|
|
13538
13649
|
markdownSyntaxHiding(),
|
|
13539
13650
|
markdownTablePreview,
|
|
@@ -13548,13 +13659,13 @@ function editorPreset(optionsOrDialect = "markdown") {
|
|
|
13548
13659
|
}
|
|
13549
13660
|
|
|
13550
13661
|
// src/version.ts
|
|
13551
|
-
var VERSION = "0.
|
|
13552
|
-
var GIT_SHA = "
|
|
13553
|
-
var BUILD_TIME = "2026-10-
|
|
13662
|
+
var VERSION = "0.45.2166";
|
|
13663
|
+
var GIT_SHA = "32bda10";
|
|
13664
|
+
var BUILD_TIME = "2026-10-26T20:01:09.868Z";
|
|
13554
13665
|
var SEMVER = {
|
|
13555
|
-
version: "0.
|
|
13556
|
-
gitSha: "
|
|
13557
|
-
buildTime: "2026-10-
|
|
13666
|
+
version: "0.45.2166",
|
|
13667
|
+
gitSha: "32bda10",
|
|
13668
|
+
buildTime: "2026-10-26T20:01:09.868Z"
|
|
13558
13669
|
};
|
|
13559
13670
|
|
|
13560
13671
|
Object.defineProperty(exports, "CONTENT_GROUPING_DIMENSIONS", {
|
|
@@ -13629,14 +13740,15 @@ exports.WqlTimeseries = WqlTimeseries;
|
|
|
13629
13740
|
exports.ZoneDistribution = ZoneDistribution;
|
|
13630
13741
|
exports.activeCursorSection = activeCursorSection;
|
|
13631
13742
|
exports.addRuntimePanel = addRuntimePanel;
|
|
13743
|
+
exports.autocompleteTooltipTheme = autocompleteTooltipTheme;
|
|
13632
13744
|
exports.blockTypesFromBlocks = blockTypesFromBlocks;
|
|
13633
13745
|
exports.canonicalSuggestionItems = canonicalSuggestionItems;
|
|
13634
|
-
exports.catalogIdsFromBlocks = catalogIdsFromBlocks;
|
|
13635
13746
|
exports.cn = cn;
|
|
13636
13747
|
exports.compactNumber = compactNumber;
|
|
13637
13748
|
exports.composerRegistry = composerRegistry;
|
|
13638
13749
|
exports.configureOverlayActions = configureOverlayActions;
|
|
13639
13750
|
exports.cursorFocusExtension = cursorFocusExtension;
|
|
13751
|
+
exports.customCompletionSources = customCompletionSources;
|
|
13640
13752
|
exports.dateRangeSlot = dateRangeSlot;
|
|
13641
13753
|
exports.dispatchAddRuntimePanel = dispatchAddRuntimePanel;
|
|
13642
13754
|
exports.dispatchExpandRuntimePanel = dispatchExpandRuntimePanel;
|
|
@@ -13685,7 +13797,10 @@ exports.mergeSeries = mergeSeries;
|
|
|
13685
13797
|
exports.mergeSuggestionItems = mergeSuggestionItems;
|
|
13686
13798
|
exports.mergeTagSuggestions = mergeTagSuggestions;
|
|
13687
13799
|
exports.navigationFacet = navigationFacet;
|
|
13800
|
+
exports.nestedCompletion = nestedCompletion;
|
|
13801
|
+
exports.nestedCompletionOptions = nestedCompletionOptions;
|
|
13688
13802
|
exports.normalizeOutputFilter = normalizeOutputFilter;
|
|
13803
|
+
exports.notebookSlugsFromBlocks = notebookSlugsFromBlocks;
|
|
13689
13804
|
exports.patchBlockQuery = patchBlockQuery;
|
|
13690
13805
|
exports.presentBadges = presentBadges;
|
|
13691
13806
|
exports.previewDecorations = previewDecorations;
|
|
@@ -13693,9 +13808,9 @@ exports.queryBlockPreview = queryBlockPreview;
|
|
|
13693
13808
|
exports.readSessionRpe = readSessionRpe;
|
|
13694
13809
|
exports.readStoredUnit = readStoredUnit;
|
|
13695
13810
|
exports.referenceIndexReload = referenceIndexReload;
|
|
13696
|
-
exports.registerCustomCompletionSource = registerCustomCompletionSource;
|
|
13697
13811
|
exports.registeredSectionWidgets = registeredSectionWidgets;
|
|
13698
13812
|
exports.removeRuntimePanel = removeRuntimePanel;
|
|
13813
|
+
exports.resolveCodeLanguage = resolveCodeLanguage;
|
|
13699
13814
|
exports.resolveQueryDraft = resolveQueryDraft;
|
|
13700
13815
|
exports.runtimePanelField = runtimePanelField;
|
|
13701
13816
|
exports.saveBlockQuerySource = saveBlockQuerySource;
|
|
@@ -13718,7 +13833,6 @@ exports.summarizePipeline = summarizePipeline;
|
|
|
13718
13833
|
exports.tagsFromStaticBlocks = tagsFromStaticBlocks;
|
|
13719
13834
|
exports.toggleWidgetEdit = toggleWidgetEdit;
|
|
13720
13835
|
exports.tooltipTimestamp = tooltipTimestamp;
|
|
13721
|
-
exports.unregisterCustomCompletionSource = unregisterCustomCompletionSource;
|
|
13722
13836
|
exports.urlAtPos = urlAtPos;
|
|
13723
13837
|
exports.useAnalyticsQueries = useAnalyticsQueries;
|
|
13724
13838
|
exports.useAnalyticsUnitPreference = useAnalyticsUnitPreference;
|
|
@@ -13730,6 +13844,7 @@ exports.useWqlStageCounts = useWqlStageCounts;
|
|
|
13730
13844
|
exports.widgetBlockPreview = widgetBlockPreview;
|
|
13731
13845
|
exports.wodAutoWrap = wodAutoWrap;
|
|
13732
13846
|
exports.wodAutocompletion = wodAutocompletion;
|
|
13847
|
+
exports.wodCompletionSource = wodCompletionSource;
|
|
13733
13848
|
exports.wodEditorKeymap = wodEditorKeymap;
|
|
13734
13849
|
exports.wodLinter = wodLinter;
|
|
13735
13850
|
exports.wodOverlayPanel = wodOverlayPanel;
|