@bitcobblers/wod-wiki-lang 0.44.2160 → 0.45.2167
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/{browserRuntimeNow-_zhhbzoE.d.cts → browserRuntimeNow-CnGciOM0.d.cts} +15 -11
- package/dist/{browserRuntimeNow-_zhhbzoE.d.ts → browserRuntimeNow-CnGciOM0.d.ts} +15 -11
- package/dist/index.cjs +350 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +110 -32
- package/dist/index.d.ts +110 -32
- package/dist/index.mjs +342 -31
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/package.json +4 -3
|
@@ -38,19 +38,19 @@ type EffortRegistrySource = 'bundled' | 'user' | 'synthetic-unresolved';
|
|
|
38
38
|
* resolver phantoms, never listed) — the WQL `origin:` filter vocabulary. */
|
|
39
39
|
declare const EFFORT_REGISTRY_ORIGINS: readonly ["bundled", "user"];
|
|
40
40
|
/**
|
|
41
|
-
* Precedence tiers for resolving collisions across seed
|
|
41
|
+
* Precedence tiers for resolving collisions across seed sources and local edits.
|
|
42
42
|
* Order: core (0) < community (1) < imported (2) < user (3).
|
|
43
43
|
*/
|
|
44
|
-
type
|
|
45
|
-
declare const
|
|
44
|
+
type SeedPrecedenceTier = 'core' | 'community' | 'imported' | 'user';
|
|
45
|
+
declare const SEED_PRECEDENCE_RANK: Readonly<Record<SeedPrecedenceTier, number>>;
|
|
46
46
|
/** Resolve the precedence tier for a seed source id or checkpoint key (`seed:<id>`). */
|
|
47
|
-
declare function resolveSourceTier(sourceIdOrMetaKey?: string | null, explicitTier?:
|
|
48
|
-
declare function resolveSourceRank(sourceIdOrMetaKey?: string | null, explicitTier?:
|
|
47
|
+
declare function resolveSourceTier(sourceIdOrMetaKey?: string | null, explicitTier?: SeedPrecedenceTier): SeedPrecedenceTier;
|
|
48
|
+
declare function resolveSourceRank(sourceIdOrMetaKey?: string | null, explicitTier?: SeedPrecedenceTier): number;
|
|
49
49
|
/** Resolve the precedence tier of an effort/equipment definition record. */
|
|
50
50
|
declare function resolveEntityTier(entity: {
|
|
51
51
|
registrySource?: string;
|
|
52
52
|
sourceId?: string | null;
|
|
53
|
-
}):
|
|
53
|
+
}): SeedPrecedenceTier;
|
|
54
54
|
declare function resolveEntityRank(entity: {
|
|
55
55
|
registrySource?: string;
|
|
56
56
|
sourceId?: string | null;
|
|
@@ -105,9 +105,11 @@ interface IEffort {
|
|
|
105
105
|
equipment?: string[];
|
|
106
106
|
/** Owning note in the content store, when this record is a note projection. */
|
|
107
107
|
ownerNoteId?: string;
|
|
108
|
-
/**
|
|
108
|
+
/** The registered feed that delivered this record — the feed's own id.
|
|
109
|
+
* The persisted field name is kept so stored records keep resolving their
|
|
110
|
+
* precedence tier. */
|
|
109
111
|
sourceId?: string;
|
|
110
|
-
/** Source file path within the originating
|
|
112
|
+
/** Source file path within the originating seed corpus. */
|
|
111
113
|
sourcePath?: string;
|
|
112
114
|
/** Clone-based derivation metadata (user efforts only) */
|
|
113
115
|
derivation?: EffortDerivation;
|
|
@@ -166,9 +168,11 @@ interface IEquipment {
|
|
|
166
168
|
body?: string;
|
|
167
169
|
/** Owning note in the content store, when this record is a note projection. */
|
|
168
170
|
ownerNoteId?: string;
|
|
169
|
-
/**
|
|
171
|
+
/** The registered feed that delivered this record — the feed's own id.
|
|
172
|
+
* The persisted field name is kept so stored records keep resolving their
|
|
173
|
+
* precedence tier. */
|
|
170
174
|
sourceId?: string;
|
|
171
|
-
/** Source file path within the originating
|
|
175
|
+
/** Source file path within the originating seed corpus. */
|
|
172
176
|
sourcePath?: string;
|
|
173
177
|
/** ISO timestamp */
|
|
174
178
|
createdAt?: string;
|
|
@@ -2813,4 +2817,4 @@ declare function getRuntimeNowMs(): number;
|
|
|
2813
2817
|
/** Creates an INowProvider that reads the browser sender-clock when available. */
|
|
2814
2818
|
declare function createBrowserRuntimeNow(): INowProvider;
|
|
2815
2819
|
|
|
2816
|
-
export { type IEventHandler as $, type AnalyticsContext as A, type BehaviorEventType as B, type IBlockContext as C, type MetricVisibility as D, type EffortResolverOptions as E, type BlockLifecycleOptions as F, type CompletionDecision as G, type IRuntimeMemory as H, type IEquipment as I, TypedMemoryReference as J, type MemorySearchCriteria as K, type IMemoryReference as L, type MemoryTag as M, type RuntimeStackLogger as N, type OutputListener as O, type StackObserver as P, type StackSnapshot as Q, type ReferenceIndex as R, type SubscribeOptions as S, TimeSpan as T, type Unsubscribe as U, type StackListener as V, WhiteboardScript as W, MemoryTypeEnum as X, type IAnchorValue as Y, type SoundProfile as Z, type ButtonConfig as _, type ReferenceResolutionDefaults as a, type
|
|
2820
|
+
export { type IEventHandler as $, type AnalyticsContext as A, type BehaviorEventType as B, type IBlockContext as C, type MetricVisibility as D, type EffortResolverOptions as E, type BlockLifecycleOptions as F, type CompletionDecision as G, type IRuntimeMemory as H, type IEquipment as I, TypedMemoryReference as J, type MemorySearchCriteria as K, type IMemoryReference as L, type MemoryTag as M, type RuntimeStackLogger as N, type OutputListener as O, type StackObserver as P, type StackSnapshot as Q, type ReferenceIndex as R, type SubscribeOptions as S, TimeSpan as T, type Unsubscribe as U, type StackListener as V, WhiteboardScript as W, MemoryTypeEnum as X, type IAnchorValue as Y, type SoundProfile as Z, type ButtonConfig as _, type ReferenceResolutionDefaults as a, type SeedPrecedenceTier as a$, type HandlerScope as a0, type IScriptRuntime as a1, type TestableBlockConfig as a2, type IRuntimeOptions as a3, ScriptRuntime as a4, type EventHandlerOptions as a5, type EventCallback as a6, type TimerState as a7, type CalculationDefinition as a8, type IRealtimeProcessor as a9, EFFORT_REGISTRY_ORIGINS as aA, type EffortBaseAttributes as aB, type EffortDerivation as aC, type EffortDiscipline as aD, type EffortMaterializer as aE, type EffortResolvedFrom as aF, type EquipmentStorageAdapter as aG, type FenceDialect as aH, type FragmentDisplayState as aI, type FragmentState as aJ, type IAnalyticsProcessorDescriptor as aK, type IEquipmentRegistry as aL, INTENSITY_TIERS as aM, type IScript as aN, type IntensityTier as aO, type InterceptMode as aP, MemoryLocation as aQ, type MemoryType as aR, type MemoryTypeMap as aS, type MemoryValueOf as aT, NAMED_COMPOUNDS as aU, type ReferenceCatalog as aV, type ResolvedReferences as aW, type RoundState as aX, type RuntimeState as aY, SEED_PRECEDENCE_RANK as aZ, type ScriptRuntimeDependencies as a_, type ISummaryProcessor as aa, type ProjectionResult as ab, type DimVector as ac, type CalcLine as ad, type ExprNode as ae, type CalcScope as af, type BinaryOp as ag, type ButtonVariant as ah, type ButtonsState as ai, type CalcNode as aj, type CalcOrigin as ak, type CalcVariant as al, type ChildrenStatusState as am, type CompletionState as an, DEFAULT_RESOLVER_OPTIONS as ao, DEFAULT_RUNTIME_OPTIONS as ap, DEFAULT_SOUND_PROFILE as aq, DIM_COUNT as ar, DIM_ENERGY as as, DIM_LENGTH as at, DIM_MASS as au, DIM_TIME as av, DIM_ZERO as aw, DISCIPLINE_FACTORS as ax, type DisplayState as ay, EFFORT_DISCIPLINES as az, type IEffort as b, type SoundRule as b0, type SoundTriggerAnchor as b1, type SoundTriggerPoint as b2, type StackEvent as b3, type TimerDirection as b4, VISIBILITY_ICONS as b5, VISIBILITY_LABELS as b6, addDim as b7, compoundName as b8, createBrowserRuntimeNow as b9, createReferenceIndex as ba, dedupeEntitiesByPrecedence as bb, dimEquals as bc, disciplineFactorFor as bd, extractStatementRefs as be, filterTagsByVisibility as bf, formatDim as bg, formatSoundTrigger as bh, frozenNow as bi, getMetricVisibility as bj, getRuntimeNowMs as bk, isDimensionless as bl, isEffortDiscipline as bm, isFragmentTag as bn, parseSoundTrigger as bo, resolveEntityRank as bp, resolveEntityTier as bq, resolveProfileRules as br, resolveSourceRank as bs, resolveSourceTier as bt, slugifyRefLabel as bu, subDim as bv, wallClockNow as bw, type IEffortResolver as c, type IEffortRegistry as d, type EffortResolutionOptions as e, type ResolvedEffort as f, type EffortRegistrySource as g, type EffortStorageAdapter as h, type IRuntimeActionable as i, type IEventBus as j, type IRuntimeStack as k, type IRuntimeClock as l, type IJitCompiler as m, type INowProvider as n, type RuntimeStackOptions as o, type RuntimeError as p, type IEvent as q, type IRuntimeAction as r, type IAnalyticsEngine as s, type IRuntimeBlock as t, type IBehaviorContext as u, type BehaviorEventListener as v, type Unsubscribe$1 as w, type OutputOptions as x, type IMemoryLocation as y, type IRuntimeBehavior as z };
|
|
@@ -38,19 +38,19 @@ type EffortRegistrySource = 'bundled' | 'user' | 'synthetic-unresolved';
|
|
|
38
38
|
* resolver phantoms, never listed) — the WQL `origin:` filter vocabulary. */
|
|
39
39
|
declare const EFFORT_REGISTRY_ORIGINS: readonly ["bundled", "user"];
|
|
40
40
|
/**
|
|
41
|
-
* Precedence tiers for resolving collisions across seed
|
|
41
|
+
* Precedence tiers for resolving collisions across seed sources and local edits.
|
|
42
42
|
* Order: core (0) < community (1) < imported (2) < user (3).
|
|
43
43
|
*/
|
|
44
|
-
type
|
|
45
|
-
declare const
|
|
44
|
+
type SeedPrecedenceTier = 'core' | 'community' | 'imported' | 'user';
|
|
45
|
+
declare const SEED_PRECEDENCE_RANK: Readonly<Record<SeedPrecedenceTier, number>>;
|
|
46
46
|
/** Resolve the precedence tier for a seed source id or checkpoint key (`seed:<id>`). */
|
|
47
|
-
declare function resolveSourceTier(sourceIdOrMetaKey?: string | null, explicitTier?:
|
|
48
|
-
declare function resolveSourceRank(sourceIdOrMetaKey?: string | null, explicitTier?:
|
|
47
|
+
declare function resolveSourceTier(sourceIdOrMetaKey?: string | null, explicitTier?: SeedPrecedenceTier): SeedPrecedenceTier;
|
|
48
|
+
declare function resolveSourceRank(sourceIdOrMetaKey?: string | null, explicitTier?: SeedPrecedenceTier): number;
|
|
49
49
|
/** Resolve the precedence tier of an effort/equipment definition record. */
|
|
50
50
|
declare function resolveEntityTier(entity: {
|
|
51
51
|
registrySource?: string;
|
|
52
52
|
sourceId?: string | null;
|
|
53
|
-
}):
|
|
53
|
+
}): SeedPrecedenceTier;
|
|
54
54
|
declare function resolveEntityRank(entity: {
|
|
55
55
|
registrySource?: string;
|
|
56
56
|
sourceId?: string | null;
|
|
@@ -105,9 +105,11 @@ interface IEffort {
|
|
|
105
105
|
equipment?: string[];
|
|
106
106
|
/** Owning note in the content store, when this record is a note projection. */
|
|
107
107
|
ownerNoteId?: string;
|
|
108
|
-
/**
|
|
108
|
+
/** The registered feed that delivered this record — the feed's own id.
|
|
109
|
+
* The persisted field name is kept so stored records keep resolving their
|
|
110
|
+
* precedence tier. */
|
|
109
111
|
sourceId?: string;
|
|
110
|
-
/** Source file path within the originating
|
|
112
|
+
/** Source file path within the originating seed corpus. */
|
|
111
113
|
sourcePath?: string;
|
|
112
114
|
/** Clone-based derivation metadata (user efforts only) */
|
|
113
115
|
derivation?: EffortDerivation;
|
|
@@ -166,9 +168,11 @@ interface IEquipment {
|
|
|
166
168
|
body?: string;
|
|
167
169
|
/** Owning note in the content store, when this record is a note projection. */
|
|
168
170
|
ownerNoteId?: string;
|
|
169
|
-
/**
|
|
171
|
+
/** The registered feed that delivered this record — the feed's own id.
|
|
172
|
+
* The persisted field name is kept so stored records keep resolving their
|
|
173
|
+
* precedence tier. */
|
|
170
174
|
sourceId?: string;
|
|
171
|
-
/** Source file path within the originating
|
|
175
|
+
/** Source file path within the originating seed corpus. */
|
|
172
176
|
sourcePath?: string;
|
|
173
177
|
/** ISO timestamp */
|
|
174
178
|
createdAt?: string;
|
|
@@ -2813,4 +2817,4 @@ declare function getRuntimeNowMs(): number;
|
|
|
2813
2817
|
/** Creates an INowProvider that reads the browser sender-clock when available. */
|
|
2814
2818
|
declare function createBrowserRuntimeNow(): INowProvider;
|
|
2815
2819
|
|
|
2816
|
-
export { type IEventHandler as $, type AnalyticsContext as A, type BehaviorEventType as B, type IBlockContext as C, type MetricVisibility as D, type EffortResolverOptions as E, type BlockLifecycleOptions as F, type CompletionDecision as G, type IRuntimeMemory as H, type IEquipment as I, TypedMemoryReference as J, type MemorySearchCriteria as K, type IMemoryReference as L, type MemoryTag as M, type RuntimeStackLogger as N, type OutputListener as O, type StackObserver as P, type StackSnapshot as Q, type ReferenceIndex as R, type SubscribeOptions as S, TimeSpan as T, type Unsubscribe as U, type StackListener as V, WhiteboardScript as W, MemoryTypeEnum as X, type IAnchorValue as Y, type SoundProfile as Z, type ButtonConfig as _, type ReferenceResolutionDefaults as a, type
|
|
2820
|
+
export { type IEventHandler as $, type AnalyticsContext as A, type BehaviorEventType as B, type IBlockContext as C, type MetricVisibility as D, type EffortResolverOptions as E, type BlockLifecycleOptions as F, type CompletionDecision as G, type IRuntimeMemory as H, type IEquipment as I, TypedMemoryReference as J, type MemorySearchCriteria as K, type IMemoryReference as L, type MemoryTag as M, type RuntimeStackLogger as N, type OutputListener as O, type StackObserver as P, type StackSnapshot as Q, type ReferenceIndex as R, type SubscribeOptions as S, TimeSpan as T, type Unsubscribe as U, type StackListener as V, WhiteboardScript as W, MemoryTypeEnum as X, type IAnchorValue as Y, type SoundProfile as Z, type ButtonConfig as _, type ReferenceResolutionDefaults as a, type SeedPrecedenceTier as a$, type HandlerScope as a0, type IScriptRuntime as a1, type TestableBlockConfig as a2, type IRuntimeOptions as a3, ScriptRuntime as a4, type EventHandlerOptions as a5, type EventCallback as a6, type TimerState as a7, type CalculationDefinition as a8, type IRealtimeProcessor as a9, EFFORT_REGISTRY_ORIGINS as aA, type EffortBaseAttributes as aB, type EffortDerivation as aC, type EffortDiscipline as aD, type EffortMaterializer as aE, type EffortResolvedFrom as aF, type EquipmentStorageAdapter as aG, type FenceDialect as aH, type FragmentDisplayState as aI, type FragmentState as aJ, type IAnalyticsProcessorDescriptor as aK, type IEquipmentRegistry as aL, INTENSITY_TIERS as aM, type IScript as aN, type IntensityTier as aO, type InterceptMode as aP, MemoryLocation as aQ, type MemoryType as aR, type MemoryTypeMap as aS, type MemoryValueOf as aT, NAMED_COMPOUNDS as aU, type ReferenceCatalog as aV, type ResolvedReferences as aW, type RoundState as aX, type RuntimeState as aY, SEED_PRECEDENCE_RANK as aZ, type ScriptRuntimeDependencies as a_, type ISummaryProcessor as aa, type ProjectionResult as ab, type DimVector as ac, type CalcLine as ad, type ExprNode as ae, type CalcScope as af, type BinaryOp as ag, type ButtonVariant as ah, type ButtonsState as ai, type CalcNode as aj, type CalcOrigin as ak, type CalcVariant as al, type ChildrenStatusState as am, type CompletionState as an, DEFAULT_RESOLVER_OPTIONS as ao, DEFAULT_RUNTIME_OPTIONS as ap, DEFAULT_SOUND_PROFILE as aq, DIM_COUNT as ar, DIM_ENERGY as as, DIM_LENGTH as at, DIM_MASS as au, DIM_TIME as av, DIM_ZERO as aw, DISCIPLINE_FACTORS as ax, type DisplayState as ay, EFFORT_DISCIPLINES as az, type IEffort as b, type SoundRule as b0, type SoundTriggerAnchor as b1, type SoundTriggerPoint as b2, type StackEvent as b3, type TimerDirection as b4, VISIBILITY_ICONS as b5, VISIBILITY_LABELS as b6, addDim as b7, compoundName as b8, createBrowserRuntimeNow as b9, createReferenceIndex as ba, dedupeEntitiesByPrecedence as bb, dimEquals as bc, disciplineFactorFor as bd, extractStatementRefs as be, filterTagsByVisibility as bf, formatDim as bg, formatSoundTrigger as bh, frozenNow as bi, getMetricVisibility as bj, getRuntimeNowMs as bk, isDimensionless as bl, isEffortDiscipline as bm, isFragmentTag as bn, parseSoundTrigger as bo, resolveEntityRank as bp, resolveEntityTier as bq, resolveProfileRules as br, resolveSourceRank as bs, resolveSourceTier as bt, slugifyRefLabel as bu, subDim as bv, wallClockNow as bw, type IEffortResolver as c, type IEffortRegistry as d, type EffortResolutionOptions as e, type ResolvedEffort as f, type EffortRegistrySource as g, type EffortStorageAdapter as h, type IRuntimeActionable as i, type IEventBus as j, type IRuntimeStack as k, type IRuntimeClock as l, type IJitCompiler as m, type INowProvider as n, type RuntimeStackOptions as o, type RuntimeError as p, type IEvent as q, type IRuntimeAction as r, type IAnalyticsEngine as s, type IRuntimeBlock as t, type IBehaviorContext as u, type BehaviorEventListener as v, type Unsubscribe$1 as w, type OutputOptions as x, type IMemoryLocation as y, type IRuntimeBehavior as z };
|
package/dist/index.cjs
CHANGED
|
@@ -4,6 +4,7 @@ var wodWikiCore = require('@bitcobblers/wod-wiki-core');
|
|
|
4
4
|
var lr = require('@lezer/lr');
|
|
5
5
|
var language = require('@codemirror/language');
|
|
6
6
|
var common = require('@lezer/common');
|
|
7
|
+
var autocomplete = require('@codemirror/autocomplete');
|
|
7
8
|
var uuid = require('uuid');
|
|
8
9
|
|
|
9
10
|
// src/registry/Registry.ts
|
|
@@ -688,6 +689,40 @@ function residualMeta(effortMeta, rest) {
|
|
|
688
689
|
raw: rest
|
|
689
690
|
};
|
|
690
691
|
}
|
|
692
|
+
var TRAILING_WORD = /^([\s\S]*?)([a-zA-Z]+)$/;
|
|
693
|
+
function splitTrailingWord(text) {
|
|
694
|
+
const m = TRAILING_WORD.exec(text.trimEnd());
|
|
695
|
+
if (!m) return null;
|
|
696
|
+
return { rest: m[1].trim(), token: m[2] };
|
|
697
|
+
}
|
|
698
|
+
function trailingResidualMeta(effortMeta, rest) {
|
|
699
|
+
if (!effortMeta) return effortMeta;
|
|
700
|
+
return {
|
|
701
|
+
line: effortMeta.line,
|
|
702
|
+
startOffset: effortMeta.startOffset,
|
|
703
|
+
endOffset: effortMeta.startOffset !== void 0 ? effortMeta.startOffset + rest.length : effortMeta.endOffset,
|
|
704
|
+
columnStart: effortMeta.columnStart,
|
|
705
|
+
columnEnd: effortMeta.columnStart !== void 0 ? effortMeta.columnStart + rest.length : effortMeta.columnEnd,
|
|
706
|
+
length: rest.length,
|
|
707
|
+
raw: rest
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
function trailingTokenMeta(effortMeta, token) {
|
|
711
|
+
if (!effortMeta) return effortMeta;
|
|
712
|
+
const tokenStart = Math.max(
|
|
713
|
+
0,
|
|
714
|
+
(effortMeta.raw?.trimEnd().length ?? (effortMeta.endOffset ?? 0) - (effortMeta.startOffset ?? 0)) - token.length
|
|
715
|
+
);
|
|
716
|
+
return {
|
|
717
|
+
line: effortMeta.line,
|
|
718
|
+
startOffset: effortMeta.startOffset !== void 0 ? effortMeta.startOffset + tokenStart : void 0,
|
|
719
|
+
endOffset: effortMeta.startOffset !== void 0 ? effortMeta.startOffset + tokenStart + token.length : effortMeta.endOffset,
|
|
720
|
+
columnStart: effortMeta.columnStart !== void 0 ? effortMeta.columnStart + tokenStart : void 0,
|
|
721
|
+
columnEnd: effortMeta.columnStart !== void 0 ? effortMeta.columnStart + tokenStart + token.length : effortMeta.columnEnd,
|
|
722
|
+
length: token.length,
|
|
723
|
+
raw: token
|
|
724
|
+
};
|
|
725
|
+
}
|
|
691
726
|
function spanMeta(firstMeta, lastMeta) {
|
|
692
727
|
if (!firstMeta || !lastMeta) return firstMeta ?? lastMeta;
|
|
693
728
|
const startOffset = firstMeta.startOffset;
|
|
@@ -824,6 +859,22 @@ function fusePairs(pairs, units) {
|
|
|
824
859
|
}
|
|
825
860
|
}
|
|
826
861
|
}
|
|
862
|
+
if (!next) {
|
|
863
|
+
const text = effortText(cur.metric);
|
|
864
|
+
const split = text !== null ? splitTrailingWord(text) : null;
|
|
865
|
+
const unit = split ? units.get(split.token) : void 0;
|
|
866
|
+
if (split && split.rest && unit && unit.canonical === "bw") {
|
|
867
|
+
out.push({
|
|
868
|
+
metric: new EffortMetric(split.rest),
|
|
869
|
+
meta: trailingResidualMeta(cur.meta, split.rest)
|
|
870
|
+
});
|
|
871
|
+
out.push({
|
|
872
|
+
metric: metricForDimension(void 0, split.token, unit.dimension),
|
|
873
|
+
meta: trailingTokenMeta(cur.meta, split.token)
|
|
874
|
+
});
|
|
875
|
+
continue;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
827
878
|
out.push(cur);
|
|
828
879
|
}
|
|
829
880
|
return out;
|
|
@@ -955,6 +1006,13 @@ var WodDialect = class {
|
|
|
955
1006
|
return { metrics: hintsToContainer(hints) };
|
|
956
1007
|
}
|
|
957
1008
|
};
|
|
1009
|
+
var CARDIO_ACTIVITY_KEYWORDS = [
|
|
1010
|
+
{ keywords: ["RUN", "JOG", "SPRINT"], hints: ["workout.run", "behavior.aerobic"] },
|
|
1011
|
+
{ keywords: ["ROW", "ROWING"], hints: ["workout.row", "behavior.aerobic"] },
|
|
1012
|
+
{ keywords: ["BIKE", "CYCLE", "CYCLING"], hints: ["workout.bike", "behavior.aerobic"] },
|
|
1013
|
+
{ keywords: ["SWIM", "SWIMMING"], hints: ["workout.swim", "behavior.aerobic"] },
|
|
1014
|
+
{ keywords: ["WALK", "WALKING"], hints: ["workout.walk"] }
|
|
1015
|
+
];
|
|
958
1016
|
var CardioDialect = class {
|
|
959
1017
|
id = "cardio";
|
|
960
1018
|
name = "Cardio Dialect";
|
|
@@ -969,29 +1027,10 @@ var CardioDialect = class {
|
|
|
969
1027
|
analyze(statement) {
|
|
970
1028
|
const hints = [];
|
|
971
1029
|
const metrics = wodWikiCore.MetricContainer.from(statement.metrics);
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
}
|
|
977
|
-
if (this.hasKeyword(metrics, "ROW") || this.hasKeyword(metrics, "ROWING")) {
|
|
978
|
-
hints.push("domain.cardio");
|
|
979
|
-
hints.push("workout.row");
|
|
980
|
-
hints.push("behavior.aerobic");
|
|
981
|
-
}
|
|
982
|
-
if (this.hasKeyword(metrics, "BIKE") || this.hasKeyword(metrics, "CYCLE") || this.hasKeyword(metrics, "CYCLING")) {
|
|
983
|
-
hints.push("domain.cardio");
|
|
984
|
-
hints.push("workout.bike");
|
|
985
|
-
hints.push("behavior.aerobic");
|
|
986
|
-
}
|
|
987
|
-
if (this.hasKeyword(metrics, "SWIM") || this.hasKeyword(metrics, "SWIMMING")) {
|
|
988
|
-
hints.push("domain.cardio");
|
|
989
|
-
hints.push("workout.swim");
|
|
990
|
-
hints.push("behavior.aerobic");
|
|
991
|
-
}
|
|
992
|
-
if (this.hasKeyword(metrics, "WALK") || this.hasKeyword(metrics, "WALKING")) {
|
|
993
|
-
hints.push("domain.cardio");
|
|
994
|
-
hints.push("workout.walk");
|
|
1030
|
+
for (const activity of CARDIO_ACTIVITY_KEYWORDS) {
|
|
1031
|
+
if (activity.keywords.some((keyword2) => this.hasKeyword(metrics, keyword2))) {
|
|
1032
|
+
hints.push("domain.cardio", ...activity.hints);
|
|
1033
|
+
}
|
|
995
1034
|
}
|
|
996
1035
|
if (hints.length === 0 && this.hasDistance(metrics)) {
|
|
997
1036
|
hints.push("domain.cardio");
|
|
@@ -2543,7 +2582,7 @@ var WhiteboardScript = class {
|
|
|
2543
2582
|
|
|
2544
2583
|
// src/effort-registry/types.ts
|
|
2545
2584
|
var EFFORT_REGISTRY_ORIGINS = ["bundled", "user"];
|
|
2546
|
-
var
|
|
2585
|
+
var SEED_PRECEDENCE_RANK = {
|
|
2547
2586
|
core: 0,
|
|
2548
2587
|
community: 1,
|
|
2549
2588
|
imported: 2,
|
|
@@ -2559,14 +2598,14 @@ function resolveSourceTier(sourceIdOrMetaKey, explicitTier) {
|
|
|
2559
2598
|
return "imported";
|
|
2560
2599
|
}
|
|
2561
2600
|
function resolveSourceRank(sourceIdOrMetaKey, explicitTier) {
|
|
2562
|
-
return
|
|
2601
|
+
return SEED_PRECEDENCE_RANK[resolveSourceTier(sourceIdOrMetaKey, explicitTier)];
|
|
2563
2602
|
}
|
|
2564
2603
|
function resolveEntityTier(entity) {
|
|
2565
2604
|
if (entity.registrySource === "user") return "user";
|
|
2566
2605
|
return resolveSourceTier(entity.sourceId);
|
|
2567
2606
|
}
|
|
2568
2607
|
function resolveEntityRank(entity) {
|
|
2569
|
-
return
|
|
2608
|
+
return SEED_PRECEDENCE_RANK[resolveEntityTier(entity)];
|
|
2570
2609
|
}
|
|
2571
2610
|
function dedupeEntitiesByPrecedence(entities) {
|
|
2572
2611
|
const bySlug = /* @__PURE__ */ new Map();
|
|
@@ -3683,6 +3722,273 @@ tagHighlighter([
|
|
|
3683
3722
|
{ tag: tags.invalid, class: "tok-invalid" },
|
|
3684
3723
|
{ tag: tags.punctuation, class: "tok-punctuation" }
|
|
3685
3724
|
]);
|
|
3725
|
+
var whiteboardScriptSnippets = [
|
|
3726
|
+
{
|
|
3727
|
+
name: "circuit",
|
|
3728
|
+
label: "Circuit",
|
|
3729
|
+
detail: "Rounds over indented movements",
|
|
3730
|
+
template: "(${1:3})\n ${2:10 Air Squats}\n ${3:10 Push Ups}\n ${4:10 Ring Rows}\n${0}"
|
|
3731
|
+
},
|
|
3732
|
+
{
|
|
3733
|
+
name: "5x5",
|
|
3734
|
+
label: "5x5",
|
|
3735
|
+
detail: "Inline strength sets",
|
|
3736
|
+
template: "${1:5}x${2:5} ${3:Back Squat} @${4:100kg}\n${0}"
|
|
3737
|
+
},
|
|
3738
|
+
{
|
|
3739
|
+
name: "emom",
|
|
3740
|
+
label: "EMOM",
|
|
3741
|
+
detail: "Every minute on the minute",
|
|
3742
|
+
template: "(${1:10}) ${2::60 EMOM}\n + ${3:5 Burpees}\n + ${4:10 Kettlebell Swings 24kg}\n${0}"
|
|
3743
|
+
},
|
|
3744
|
+
{
|
|
3745
|
+
name: "amrap",
|
|
3746
|
+
label: "AMRAP",
|
|
3747
|
+
detail: "As many rounds as possible",
|
|
3748
|
+
template: "${1:10:00 AMRAP}\n ${2:5 Pull Ups}\n ${3:10 Push Ups}\n ${4:15 Air Squats}\n${0}"
|
|
3749
|
+
},
|
|
3750
|
+
{
|
|
3751
|
+
name: "tabata",
|
|
3752
|
+
label: "Tabata",
|
|
3753
|
+
detail: "Work/rest intervals",
|
|
3754
|
+
template: "(${1:8}) ${2::20 Work}\n * ${3::10 Rest}\n ${4:KB Snatch 16kg}\n${0}"
|
|
3755
|
+
},
|
|
3756
|
+
{
|
|
3757
|
+
name: "ladder",
|
|
3758
|
+
label: "Ladder",
|
|
3759
|
+
detail: "Rep ladder (21-15-9)",
|
|
3760
|
+
template: "(${1:21-15-9})\n ${2:Thrusters 95lb}\n ${3:Pull-ups}\n${0}"
|
|
3761
|
+
},
|
|
3762
|
+
{
|
|
3763
|
+
name: "choice",
|
|
3764
|
+
label: "Choice",
|
|
3765
|
+
detail: "Athlete choice between alternatives",
|
|
3766
|
+
template: "${1:10 Power Cleans 135/95 lb}\n${0}"
|
|
3767
|
+
},
|
|
3768
|
+
{
|
|
3769
|
+
name: "superset",
|
|
3770
|
+
label: "Superset",
|
|
3771
|
+
detail: "Compound set via + lap markers",
|
|
3772
|
+
template: "+ ${1:5 Pull Ups}\n+ ${2:10 Push Ups}\n${0}"
|
|
3773
|
+
},
|
|
3774
|
+
{
|
|
3775
|
+
name: "collectible",
|
|
3776
|
+
label: "Collectible",
|
|
3777
|
+
detail: "Measure time instead of prescribing it (:?)",
|
|
3778
|
+
template: "${1::? 400m Run}\n${0}"
|
|
3779
|
+
}
|
|
3780
|
+
];
|
|
3781
|
+
function applyTemplateDefaults(template) {
|
|
3782
|
+
return template.replace(/\$\{\d+:([^}]*)\}/g, "$1").replace(/\$\{\d+\}/g, "").replace(/\$\d+/g, "");
|
|
3783
|
+
}
|
|
3784
|
+
function snippetCompletions() {
|
|
3785
|
+
return whiteboardScriptSnippets.map(
|
|
3786
|
+
(snippet) => autocomplete.snippetCompletion(snippet.template, {
|
|
3787
|
+
label: snippet.label,
|
|
3788
|
+
detail: snippet.detail,
|
|
3789
|
+
type: "text",
|
|
3790
|
+
boost: 10
|
|
3791
|
+
})
|
|
3792
|
+
);
|
|
3793
|
+
}
|
|
3794
|
+
|
|
3795
|
+
// src/parser/completion.ts
|
|
3796
|
+
var COMPLETION_PROPERTY_KEYS = ["effort", "equipment", ...Object.keys(PROPERTY_KEY_TO_METRIC_TYPE)];
|
|
3797
|
+
var STRUCTURE_KEYWORD_LABELS = ["amrap", "emom", "tabata", "for time", "rest"];
|
|
3798
|
+
var STRUCTURE_KEYWORD_DISPLAY = {
|
|
3799
|
+
"for time": "FOR TIME",
|
|
3800
|
+
rest: "Rest"
|
|
3801
|
+
};
|
|
3802
|
+
function unitCompletions(units, dimension) {
|
|
3803
|
+
return units.toArray().filter((def) => !dimension || def.dimension === dimension).flatMap((def) => [
|
|
3804
|
+
{ label: def.canonical, detail: def.dimension, type: "unit", boost: 1 },
|
|
3805
|
+
...def.aliases.map((alias) => ({ label: alias, detail: def.dimension, type: "unit" }))
|
|
3806
|
+
]);
|
|
3807
|
+
}
|
|
3808
|
+
function titleCase(word) {
|
|
3809
|
+
return word.toLowerCase().replace(/(^|[\s])([a-z])/g, (_, lead, ch) => lead + ch.toUpperCase());
|
|
3810
|
+
}
|
|
3811
|
+
function unique(words) {
|
|
3812
|
+
return [...new Set(words)];
|
|
3813
|
+
}
|
|
3814
|
+
var SPORT_VOCABULARY = {
|
|
3815
|
+
cardio: () => unique(CARDIO_ACTIVITY_KEYWORDS.flatMap((activity) => activity.keywords)).map((word) => ({
|
|
3816
|
+
label: titleCase(word),
|
|
3817
|
+
detail: "cardio",
|
|
3818
|
+
type: "text"
|
|
3819
|
+
})),
|
|
3820
|
+
yoga: () => unique([
|
|
3821
|
+
...YogaDialect.POSE_KEYWORDS,
|
|
3822
|
+
...YogaDialect.FLOW_KEYWORDS,
|
|
3823
|
+
...YogaDialect.BREATHING_KEYWORDS,
|
|
3824
|
+
...YogaDialect.MEDITATION_KEYWORDS
|
|
3825
|
+
]).filter((word) => /^[A-Z ]+$/.test(word)).map((word) => ({ label: titleCase(word), detail: "yoga", type: "text" })),
|
|
3826
|
+
habits: () => unique([...HabitsDialect.HABIT_KEYWORDS, ...HabitsDialect.STREAK_KEYWORDS]).map((word) => ({
|
|
3827
|
+
label: titleCase(word),
|
|
3828
|
+
detail: "habits",
|
|
3829
|
+
type: "text"
|
|
3830
|
+
})),
|
|
3831
|
+
climb: () => [
|
|
3832
|
+
...unique(Object.values(SEND_ALIASES)).map((send) => ({ label: send, detail: "send", type: "text" })),
|
|
3833
|
+
...unique(Object.values(DISCIPLINE_KEYWORDS)).map((discipline) => ({ label: discipline, detail: "discipline", type: "text" }))
|
|
3834
|
+
]
|
|
3835
|
+
};
|
|
3836
|
+
function structureKeywords() {
|
|
3837
|
+
return STRUCTURE_KEYWORD_LABELS.filter((word) => STRUCTURAL_EFFORT_WORDS.has(word)).map((word) => ({
|
|
3838
|
+
label: STRUCTURE_KEYWORD_DISPLAY[word] ?? word.toUpperCase(),
|
|
3839
|
+
detail: "structure",
|
|
3840
|
+
type: "keyword",
|
|
3841
|
+
boost: 5,
|
|
3842
|
+
apply: STRUCTURE_KEYWORD_DISPLAY[word] ?? word.toUpperCase()
|
|
3843
|
+
}));
|
|
3844
|
+
}
|
|
3845
|
+
function toCompletions(values, detail, quoteValues = false) {
|
|
3846
|
+
return values.map((value) => ({
|
|
3847
|
+
label: value.label ?? value.value,
|
|
3848
|
+
// `Property` values only lex as String | Number | Identifier, and
|
|
3849
|
+
// Identifier is `[a-zA-Z][a-zA-Z0-9]*` — quote slugs it cannot represent
|
|
3850
|
+
// (hyphens, spaces, leading digits) so they insert parse-valid text;
|
|
3851
|
+
// `parsePropertyValue` unwraps the quotes when the property is consumed.
|
|
3852
|
+
apply: quoteValues && !/^[A-Za-z][A-Za-z0-9]*$/.test(value.value) ? JSON.stringify(value.value) : value.value,
|
|
3853
|
+
detail: value.detail ?? detail,
|
|
3854
|
+
type: "text",
|
|
3855
|
+
info: value.info
|
|
3856
|
+
}));
|
|
3857
|
+
}
|
|
3858
|
+
function dialectWords(sport) {
|
|
3859
|
+
if (!sport) return [];
|
|
3860
|
+
const vocabulary = SPORT_VOCABULARY[SPORT_ALIASES[sport] ?? sport];
|
|
3861
|
+
return vocabulary ? vocabulary() : [];
|
|
3862
|
+
}
|
|
3863
|
+
function ancestor(node, name2) {
|
|
3864
|
+
for (let current = node; current; current = current.parent) {
|
|
3865
|
+
if (current.name === name2) return current;
|
|
3866
|
+
}
|
|
3867
|
+
return null;
|
|
3868
|
+
}
|
|
3869
|
+
function currentStatement(context) {
|
|
3870
|
+
const tree = language.syntaxTree(context.state);
|
|
3871
|
+
const line = context.state.doc.lineAt(context.pos);
|
|
3872
|
+
if (context.pos === line.from) return null;
|
|
3873
|
+
const resolved = tree.resolveInner(context.pos, -1);
|
|
3874
|
+
const statement = ancestor(resolved, "Block") ?? ancestor(resolved, "Property");
|
|
3875
|
+
if (statement) return statement;
|
|
3876
|
+
const beforeCursor = tree.resolveInner(context.pos - 1, -1);
|
|
3877
|
+
return ancestor(beforeCursor, "Block") ?? ancestor(beforeCursor, "Property");
|
|
3878
|
+
}
|
|
3879
|
+
function suppliedPropertyKeys(context) {
|
|
3880
|
+
const keys = /* @__PURE__ */ new Set();
|
|
3881
|
+
for (const property of language.syntaxTree(context.state).topNode.getChildren("Property")) {
|
|
3882
|
+
const identifier = property.firstChild;
|
|
3883
|
+
if (identifier?.name === "Identifier") {
|
|
3884
|
+
keys.add(context.state.doc.sliceString(identifier.from, identifier.to).toLowerCase());
|
|
3885
|
+
}
|
|
3886
|
+
}
|
|
3887
|
+
return keys;
|
|
3888
|
+
}
|
|
3889
|
+
function isUnitFragment(context, fragment, units) {
|
|
3890
|
+
return fragment.firstChild?.name === "Effort" && units.has(context.state.doc.sliceString(fragment.from, fragment.to));
|
|
3891
|
+
}
|
|
3892
|
+
function trailingEffortRun(context, statement, units) {
|
|
3893
|
+
const nodes = statement?.name === "Block" ? statement.getChildren("Fragment") : [];
|
|
3894
|
+
let end = nodes.length;
|
|
3895
|
+
while (end > 0 && nodes[end - 1].from >= context.pos) end--;
|
|
3896
|
+
let start = end;
|
|
3897
|
+
while (start > 0 && nodes[start - 1].firstChild?.name === "Effort") start--;
|
|
3898
|
+
const run = nodes.slice(start, end);
|
|
3899
|
+
let firstEffort = 0;
|
|
3900
|
+
while (firstEffort < run.length - 1 && isUnitFragment(context, run[firstEffort], units)) firstEffort++;
|
|
3901
|
+
return run.slice(firstEffort);
|
|
3902
|
+
}
|
|
3903
|
+
function inNode(context, names) {
|
|
3904
|
+
for (let node = language.syntaxTree(context.state).resolveInner(context.pos, -1); node; node = node.parent) {
|
|
3905
|
+
if (names.has(node.name)) return true;
|
|
3906
|
+
}
|
|
3907
|
+
return false;
|
|
3908
|
+
}
|
|
3909
|
+
var SUPPRESSED_NODES = /* @__PURE__ */ new Set(["Text", "textComment", "Heading", "heading", "MetricObject"]);
|
|
3910
|
+
function whiteboardScriptCompletionSource(options = {}) {
|
|
3911
|
+
const sportWords = dialectWords(options.sport);
|
|
3912
|
+
const keywords = structureKeywords();
|
|
3913
|
+
const snippets = snippetCompletions();
|
|
3914
|
+
const units = options.units ?? UnitRegistry.standard();
|
|
3915
|
+
const allUnitOptions = unitCompletions(units);
|
|
3916
|
+
const massUnitOptions = unitCompletions(units, "mass");
|
|
3917
|
+
return async (context) => {
|
|
3918
|
+
if (inNode(context, SUPPRESSED_NODES)) return null;
|
|
3919
|
+
const pos = context.pos;
|
|
3920
|
+
const line = context.state.doc.lineAt(pos);
|
|
3921
|
+
const before = line.text.slice(0, pos - line.from);
|
|
3922
|
+
const word = /([A-Za-z0-9-]*)$/.exec(before)[1];
|
|
3923
|
+
const beforeWord = before.slice(0, before.length - word.length);
|
|
3924
|
+
if (beforeWord.endsWith("#") && options.tags) {
|
|
3925
|
+
return { from: pos - word.length, options: toCompletions(await options.tags(), "tag") };
|
|
3926
|
+
}
|
|
3927
|
+
const statement = currentStatement(context);
|
|
3928
|
+
if (statement?.name === "Property") {
|
|
3929
|
+
const keyNode = statement.firstChild;
|
|
3930
|
+
if (keyNode?.name !== "Identifier") return null;
|
|
3931
|
+
const key = context.state.doc.sliceString(keyNode.from, keyNode.to).toLowerCase();
|
|
3932
|
+
const value = keyNode.nextSibling;
|
|
3933
|
+
if (value && !value.type.isError && pos > value.to) return null;
|
|
3934
|
+
const source = key === "effort" ? options.efforts : key === "equipment" ? options.equipment : key === "sound" ? options.sounds : void 0;
|
|
3935
|
+
if (source) return { from: value && !value.type.isError ? value.from : pos, options: toCompletions(await source(), key, true) };
|
|
3936
|
+
return null;
|
|
3937
|
+
}
|
|
3938
|
+
const efforts = options.efforts ? toCompletions(await options.efforts(), "effort") : [];
|
|
3939
|
+
const effortOptions = [...keywords, ...efforts, ...sportWords];
|
|
3940
|
+
if (/^[ \t]*[A-Za-z][A-Za-z0-9]*$/.test(before)) {
|
|
3941
|
+
const supplied = suppliedPropertyKeys(context);
|
|
3942
|
+
return {
|
|
3943
|
+
from: pos - before.trimStart().length,
|
|
3944
|
+
options: [...COMPLETION_PROPERTY_KEYS.filter((key) => !supplied.has(key)).map((key) => ({ label: key, detail: "property", type: "property", boost: 5 })), ...snippets, ...keywords, ...efforts, ...sportWords],
|
|
3945
|
+
validFor: /^[A-Za-z]*$/
|
|
3946
|
+
};
|
|
3947
|
+
}
|
|
3948
|
+
const nodes = statement?.name === "Block" ? statement.getChildren("Fragment") : [];
|
|
3949
|
+
let end = nodes.length;
|
|
3950
|
+
while (end > 0 && nodes[end - 1].from >= pos) end--;
|
|
3951
|
+
const last = nodes[end - 1];
|
|
3952
|
+
const completingWord = last?.firstChild?.name === "Effort" && last.to === pos;
|
|
3953
|
+
const quantityFragment = completingWord ? nodes[end - 2] : last;
|
|
3954
|
+
const quantity = quantityFragment?.firstChild?.name === "Quantity" ? quantityFragment.firstChild : null;
|
|
3955
|
+
const incompleteAction = statement?.name === "Block" && statement.getChildren("Fragment").some(
|
|
3956
|
+
(fragment) => fragment.firstChild?.name === "Action" && fragment.from < (quantity?.from ?? pos) && !context.state.doc.sliceString(fragment.from, fragment.to).includes(":")
|
|
3957
|
+
);
|
|
3958
|
+
if (quantity && !incompleteAction) {
|
|
3959
|
+
return {
|
|
3960
|
+
from: completingWord ? last.from : pos,
|
|
3961
|
+
options: [...quantity.getChild("AtSign") ? massUnitOptions : allUnitOptions, ...effortOptions],
|
|
3962
|
+
validFor: /^[A-Za-z]*$/
|
|
3963
|
+
};
|
|
3964
|
+
}
|
|
3965
|
+
if (before.trim() === "") {
|
|
3966
|
+
return { from: pos, options: [...snippets, ...keywords, ...efforts, ...sportWords] };
|
|
3967
|
+
}
|
|
3968
|
+
if (word.length === 0 && /[ \t]$/.test(before)) {
|
|
3969
|
+
const effortRun = trailingEffortRun(context, statement, units);
|
|
3970
|
+
const last2 = effortRun[effortRun.length - 1];
|
|
3971
|
+
if (last2 && !isUnitFragment(context, last2, units)) return null;
|
|
3972
|
+
return { from: pos, options: effortOptions };
|
|
3973
|
+
}
|
|
3974
|
+
if (word.length > 0 && /^[A-Za-z][A-Za-z0-9'-]*$/.test(word)) {
|
|
3975
|
+
const effortRun = trailingEffortRun(context, statement, units);
|
|
3976
|
+
const first = effortRun[0];
|
|
3977
|
+
const last2 = effortRun[effortRun.length - 1];
|
|
3978
|
+
if (!first || !last2 || last2.to < pos) return null;
|
|
3979
|
+
const typed = context.state.doc.sliceString(first.from, pos).toLowerCase();
|
|
3980
|
+
const compatible = effortOptions.filter((option) => {
|
|
3981
|
+
const inserted = typeof option.apply === "string" ? option.apply : option.label;
|
|
3982
|
+
return inserted.toLowerCase().startsWith(typed);
|
|
3983
|
+
});
|
|
3984
|
+
return { from: first.from, options: compatible, validFor: /^[A-Za-z ]*$/ };
|
|
3985
|
+
}
|
|
3986
|
+
return null;
|
|
3987
|
+
};
|
|
3988
|
+
}
|
|
3989
|
+
function whiteboardScriptCompletion(options = {}) {
|
|
3990
|
+
return autocomplete.autocompletion({ override: [whiteboardScriptCompletionSource(options)] });
|
|
3991
|
+
}
|
|
3686
3992
|
|
|
3687
3993
|
// src/parser/whiteboard-script-language.ts
|
|
3688
3994
|
var whiteboardScriptLanguage = language.LRLanguage.define({
|
|
@@ -3718,8 +4024,8 @@ var whiteboardScriptLanguage = language.LRLanguage.define({
|
|
|
3718
4024
|
closeBrackets: { brackets: ["(", "[", "'", '"'] }
|
|
3719
4025
|
}
|
|
3720
4026
|
});
|
|
3721
|
-
function whiteboardScript() {
|
|
3722
|
-
return new language.LanguageSupport(whiteboardScriptLanguage);
|
|
4027
|
+
function whiteboardScript(options) {
|
|
4028
|
+
return new language.LanguageSupport(whiteboardScriptLanguage, whiteboardScriptCompletion(options ?? {}));
|
|
3723
4029
|
}
|
|
3724
4030
|
|
|
3725
4031
|
// src/effort-registry/disciplines.ts
|
|
@@ -12785,7 +13091,12 @@ var IntervalLogicStrategy = class {
|
|
|
12785
13091
|
const hasEmomAction = statements.some((s) => s.metrics.some(
|
|
12786
13092
|
(f) => (f.type === wodWikiCore.MetricType.Action || f.type === wodWikiCore.MetricType.Effort) && typeof f.value === "string" && f.value.toLowerCase() === "emom"
|
|
12787
13093
|
));
|
|
12788
|
-
|
|
13094
|
+
const isAmrapIdentified = statements.some(
|
|
13095
|
+
(s) => hasHint(s, CONSUMED_HINTS.LABEL_AMRAP) || s.metrics.some((f) => f.type === wodWikiCore.MetricType.Rounds && typeof f.value === "string" && f.value.toLowerCase() === "amrap")
|
|
13096
|
+
);
|
|
13097
|
+
const isTabataIdentified = statements.some((s) => hasHint(s, CONSUMED_HINTS.LABEL_TABATA) || s.metrics.some((f) => f.type === wodWikiCore.MetricType.Effort && typeof f.value === "string" && f.value.toLowerCase() === "tabata"));
|
|
13098
|
+
const hasIntervalCount = hasEmomAction || statements.some((s) => s.metrics.some((f) => f.type === wodWikiCore.MetricType.Rounds));
|
|
13099
|
+
return hasTimer && (isInterval || hasEmomAction) && !isAmrapIdentified && (!isTabataIdentified || hasIntervalCount);
|
|
12789
13100
|
}
|
|
12790
13101
|
apply(builder, statements, runtime) {
|
|
12791
13102
|
const firstStatementWithTimer = statements.find((s) => s.metrics.some(
|
|
@@ -15219,7 +15530,7 @@ exports.BehaviorContext = BehaviorContext;
|
|
|
15219
15530
|
exports.BlockBuilder = BlockBuilder;
|
|
15220
15531
|
exports.BlockContext = BlockContext;
|
|
15221
15532
|
exports.ButtonBehavior = ButtonBehavior;
|
|
15222
|
-
exports.
|
|
15533
|
+
exports.COMPLETION_PROPERTY_KEYS = COMPLETION_PROPERTY_KEYS;
|
|
15223
15534
|
exports.CONSUMED_HINTS = CONSUMED_HINTS;
|
|
15224
15535
|
exports.CONSUMED_HINT_KEYS = CONSUMED_HINT_KEYS;
|
|
15225
15536
|
exports.CONTEXT_ATOMS = CONTEXT_ATOMS;
|
|
@@ -15292,9 +15603,11 @@ exports.NextEvent = NextEvent;
|
|
|
15292
15603
|
exports.NextEventHandler = NextEventHandler;
|
|
15293
15604
|
exports.OutputEmitter = OutputEmitter;
|
|
15294
15605
|
exports.PRODUCTION_STRATEGIES = PRODUCTION_STRATEGIES;
|
|
15606
|
+
exports.PROPERTY_KEY_TO_METRIC_TYPE = PROPERTY_KEY_TO_METRIC_TYPE;
|
|
15295
15607
|
exports.PopBlockAction = PopBlockAction;
|
|
15296
15608
|
exports.PushBlockAction = PushBlockAction;
|
|
15297
15609
|
exports.PushRestBlockAction = PushRestBlockAction;
|
|
15610
|
+
exports.REFERENCE_PAIR_KEYS = REFERENCE_PAIR_KEYS;
|
|
15298
15611
|
exports.REST_EXCLUSION = REST_EXCLUSION;
|
|
15299
15612
|
exports.RPE_LABELS = RPE_LABELS;
|
|
15300
15613
|
exports.RUNTIME_LOG_SUBJECT_WIDTH = RUNTIME_LOG_SUBJECT_WIDTH;
|
|
@@ -15313,11 +15626,13 @@ exports.RuntimeLogger = RuntimeLogger;
|
|
|
15313
15626
|
exports.RuntimeMemory = RuntimeMemory;
|
|
15314
15627
|
exports.RuntimeObservers = RuntimeObservers;
|
|
15315
15628
|
exports.RuntimeStack = RuntimeStack;
|
|
15629
|
+
exports.SEED_PRECEDENCE_RANK = SEED_PRECEDENCE_RANK;
|
|
15316
15630
|
exports.SOUND_PLAY_EVENT = SOUND_PLAY_EVENT;
|
|
15317
15631
|
exports.SOUND_PROFILE_METRIC = SOUND_PROFILE_METRIC;
|
|
15318
15632
|
exports.STANDARD_UNITS = STANDARD_UNITS;
|
|
15319
15633
|
exports.STORE_CALCS = STORE_CALCS;
|
|
15320
15634
|
exports.STREAM_ATOMS = STREAM_ATOMS;
|
|
15635
|
+
exports.STRUCTURAL_EFFORT_WORDS = STRUCTURAL_EFFORT_WORDS;
|
|
15321
15636
|
exports.ScriptRuntime = ScriptRuntime;
|
|
15322
15637
|
exports.SessionRootBlock = SessionRootBlock;
|
|
15323
15638
|
exports.SessionRootStrategy = SessionRootStrategy;
|
|
@@ -15350,6 +15665,7 @@ exports.WodDialect = WodDialect;
|
|
|
15350
15665
|
exports.YogaDialect = YogaDialect;
|
|
15351
15666
|
exports.addAliasToEffort = addAliasToEffort;
|
|
15352
15667
|
exports.addDim = addDim;
|
|
15668
|
+
exports.applyTemplateDefaults = applyTemplateDefaults;
|
|
15353
15669
|
exports.buildStaticLookups = buildStaticLookups;
|
|
15354
15670
|
exports.buildTooltip = buildTooltip;
|
|
15355
15671
|
exports.bundledEfforts = bundledEfforts;
|
|
@@ -15475,6 +15791,7 @@ exports.resolveSourceRank = resolveSourceRank;
|
|
|
15475
15791
|
exports.resolveSourceTier = resolveSourceTier;
|
|
15476
15792
|
exports.resolveTagContributions = resolveTagContributions;
|
|
15477
15793
|
exports.slugifyRefLabel = slugifyRefLabel;
|
|
15794
|
+
exports.snippetCompletions = snippetCompletions;
|
|
15478
15795
|
exports.startSpan = startSpan;
|
|
15479
15796
|
exports.str = str;
|
|
15480
15797
|
exports.strategyRegistry = strategyRegistry;
|
|
@@ -15490,7 +15807,10 @@ exports.validateOutputUnit = validateOutputUnit;
|
|
|
15490
15807
|
exports.wallClockNow = wallClockNow;
|
|
15491
15808
|
exports.whiteboardParser = parser;
|
|
15492
15809
|
exports.whiteboardScript = whiteboardScript;
|
|
15810
|
+
exports.whiteboardScriptCompletion = whiteboardScriptCompletion;
|
|
15811
|
+
exports.whiteboardScriptCompletionSource = whiteboardScriptCompletionSource;
|
|
15493
15812
|
exports.whiteboardScriptLanguage = whiteboardScriptLanguage;
|
|
15813
|
+
exports.whiteboardScriptSnippets = whiteboardScriptSnippets;
|
|
15494
15814
|
exports.writeChoiceSelection = writeChoiceSelection;
|
|
15495
15815
|
//# sourceMappingURL=index.cjs.map
|
|
15496
15816
|
//# sourceMappingURL=index.cjs.map
|