@almadar/ui 6.55.0 → 6.57.0

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.
Files changed (59) hide show
  1. package/dist/{ArbitraryClassCompiler-DvzdeHxc.d.ts → ArbitraryClassCompiler-tChQ3nVq.d.ts} +15 -1
  2. package/dist/{FileTree-DUi7e7Z8.d.ts → FileTree-BSfgp-HH.d.ts} +29 -2
  3. package/dist/Typography-LZTP72Y4.js +5 -0
  4. package/dist/{UISlotRenderer-QTHFT6Z4.js → UISlotRenderer-NCGDIXN4.js} +8 -8
  5. package/dist/avl/index.cjs +4832 -4212
  6. package/dist/avl/index.d.ts +74 -5
  7. package/dist/avl/index.js +68 -711
  8. package/dist/{avl-schema-parser-C0wnAp5x.d.ts → avl-schema-parser-CH1QoZw1.d.ts} +1 -1
  9. package/dist/{chunk-HCSJHRC4.js → chunk-4ZGXIW3B.js} +1 -1
  10. package/dist/{chunk-RNY5LJXJ.js → chunk-723MJUU3.js} +1 -1
  11. package/dist/{chunk-6EV3OEBQ.js → chunk-CHNC4UYE.js} +3 -2
  12. package/dist/{chunk-SGJHVPHC.js → chunk-GZGDBS4S.js} +2 -2
  13. package/dist/{chunk-Y53Q55H5.js → chunk-HA7CJWQX.js} +1123 -1121
  14. package/dist/{chunk-JRW33U35.js → chunk-I5QOYW2Z.js} +1 -1
  15. package/dist/{chunk-KQXXO42S.js → chunk-KJGVLXEN.js} +78 -1
  16. package/dist/{chunk-HRCR53OW.js → chunk-LZRW6GXG.js} +18 -3
  17. package/dist/{chunk-2LFBQ4IS.js → chunk-MZIDOJMD.js} +2 -2
  18. package/dist/{chunk-QGH4NAQO.js → chunk-N7JIG57B.js} +9 -4
  19. package/dist/{chunk-XZKGRSIO.js → chunk-PYJ2UQWM.js} +2487 -1156
  20. package/dist/{chunk-FQM37C56.js → chunk-RHP5WL55.js} +61 -55
  21. package/dist/chunk-YYYHH5BA.js +2519 -0
  22. package/dist/{cn-ClXGlIOY.d.ts → cn-DIql5232.d.ts} +152 -24
  23. package/dist/components/index.cjs +6876 -3072
  24. package/dist/components/index.d.ts +45 -94
  25. package/dist/components/index.js +14 -16
  26. package/dist/context/index.cjs +23 -0
  27. package/dist/context/index.d.ts +2 -2
  28. package/dist/context/index.js +20 -1
  29. package/dist/hooks/index.cjs +2544 -7
  30. package/dist/hooks/index.d.ts +4 -1
  31. package/dist/hooks/index.js +7 -6
  32. package/dist/lib/drawable/three/index.cjs +22 -6
  33. package/dist/lib/drawable/three/index.d.ts +1 -1
  34. package/dist/lib/drawable/three/index.js +7 -7
  35. package/dist/lib/index.cjs +18 -3
  36. package/dist/lib/index.d.ts +1 -1
  37. package/dist/lib/index.js +3 -4
  38. package/dist/locales/index.cjs +54 -9
  39. package/dist/locales/index.js +2 -2489
  40. package/dist/providers/index.cjs +4035 -2382
  41. package/dist/providers/index.d.ts +2 -2
  42. package/dist/providers/index.js +24 -13
  43. package/dist/runtime/index.cjs +4092 -2447
  44. package/dist/runtime/index.d.ts +0 -13
  45. package/dist/runtime/index.js +11 -10
  46. package/dist/ssr/index.cjs +23 -6
  47. package/dist/ssr/index.js +23 -6
  48. package/dist/{useEventBus-JUAH3EFW.js → useEventBus-SWRN475O.js} +1 -1
  49. package/locales/ar.json +18 -3
  50. package/locales/en.json +18 -3
  51. package/locales/sl.json +18 -3
  52. package/package.json +6 -6
  53. package/tailwind-preset.cjs +6 -0
  54. package/themes/_fonts.css +1 -1
  55. package/themes/_presets.css +1 -0
  56. package/themes/kflow.css +299 -0
  57. package/dist/Typography-7PDT62PG.js +0 -5
  58. package/dist/chunk-F4ZTPKZL.js +0 -284
  59. package/dist/chunk-OKWD7LPO.js +0 -80
@@ -1,4 +1,4 @@
1
- import { useEventBus } from './chunk-6EV3OEBQ.js';
1
+ import { useEventBus } from './chunk-CHNC4UYE.js';
2
2
  import { createContext, useCallback, useSyncExternalStore, useRef, useState, useContext, useEffect, useMemo } from 'react';
3
3
 
4
4
  function useMediaQuery(query) {
@@ -1118,4 +1118,81 @@ function initDebugShortcut() {
1118
1118
  return () => window.removeEventListener("keydown", handleKeyDown);
1119
1119
  }
1120
1120
 
1121
- export { EDITOR_MOTIONS, EDITOR_OPERATORS, ENTER_SLOT_CLASS, INDENT_UNIT, MAX_ENTER_DELAY, Presence, applyMotion, applyOperator, arrowheadPath, asEnterAnimation, brainIconPath, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, computeLineDiff, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, eightPointedStarPath, enterClassName, gearTeethPath, getAllTicks, getAllTraits, getDebugEvents, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getRecentEvents, getRecentGuardEvaluations, getTick, getTrait, initDebugShortcut, isDebugEnabled, isDebugEnabled2, isEditorMotion, isEditorOperator, isMotionEnabled, lockIconPath, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, motionRange, onDebugToggle, parseContentSegments, parseMarkdownWithCodeBlocks, parseMarkdownWithCodeBlocks2, pipeIconPath, profilerOnRender, recordGuardEvaluation, registerTick, registerTrait, resolveImageUrl, setDebugEnabled, setEntityProvider, setTickActive, slotPlaysDefaultEnter, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, toggleDebug, unregisterTick, unregisterTrait, updateGuardResult, updateTickExecution, updateTraitState, usePerfBuffer, usePresence, useSlotEnterRestart };
1121
+ // lib/parseLessonSegments.ts
1122
+ function extractTagContent(content, tagName) {
1123
+ const closedTagRegex = new RegExp(`<${tagName}>([\\s\\S]*?)<\\/${tagName}>`, "i");
1124
+ const closedMatch = content.match(closedTagRegex);
1125
+ if (closedMatch) {
1126
+ return { content: closedMatch[1].trim(), fullMatch: closedMatch[0] };
1127
+ }
1128
+ const unclosedTagRegex = new RegExp(
1129
+ `<${tagName}>([\\s\\S]*?)(?=<(?:activate|connect|reflect|bloom|prq|question|answer|visualize)|\\n\\n#|$)`,
1130
+ "i"
1131
+ );
1132
+ const unclosedMatch = content.match(unclosedTagRegex);
1133
+ if (unclosedMatch) {
1134
+ return { content: unclosedMatch[1].trim(), fullMatch: unclosedMatch[0] };
1135
+ }
1136
+ return null;
1137
+ }
1138
+ function parseLessonSegments(lesson) {
1139
+ if (!lesson) return [];
1140
+ let content = lesson.replace(/<prq>[\s\S]*?<\/prq>/gi, "").trim();
1141
+ const segments = [];
1142
+ const activateResult = extractTagContent(content, "activate");
1143
+ if (activateResult) {
1144
+ segments.push({ type: "activate", question: activateResult.content });
1145
+ content = content.replace(activateResult.fullMatch, "").trim();
1146
+ }
1147
+ const connectResult = extractTagContent(content, "connect");
1148
+ if (connectResult) {
1149
+ segments.push({ type: "connect", content: connectResult.content });
1150
+ content = content.replace(connectResult.fullMatch, "").trim();
1151
+ }
1152
+ const tagRegex = new RegExp(
1153
+ '(?<reflect><reflect>(?<reflectClosed>[\\s\\S]*?)<\\/reflect>)|(?<reflectUnclosed><reflect>(?<reflectOpen>[\\s\\S]*?)(?=<(?:activate|connect|reflect|bloom|prq|question|answer|visualize)|\\n\\n#|$))|(?<bloom><bloom\\s+level="(?<bloomLevel>remember|understand|apply|analyze|evaluate|create)">(?<bloomClosed>[\\s\\S]*?)<\\/bloom>)|(?<bloomUnclosed><bloom\\s+level="(?<bloomLevelUn>remember|understand|apply|analyze|evaluate|create)">(?<bloomOpen>[\\s\\S]*?)(?=<(?:activate|connect|reflect|bloom|prq|question|answer|visualize)|\\n\\n#|$))|(?<quiz><question>(?<quizQuestion>[\\s\\S]*?)<\\/question>\\s*<answer>(?<quizAnswer>[\\s\\S]*?)<\\/answer>)|(?<visualize><visualize\\s+type="(?<vizType>algorithms|math|physics|biology|chemistry|probability)"\\s+description="(?<vizDesc>[^"]*?)"\\s*\\/?>)',
1154
+ "gi"
1155
+ );
1156
+ let lastIndex = 0;
1157
+ let match;
1158
+ while ((match = tagRegex.exec(content)) !== null) {
1159
+ const before = content.slice(lastIndex, match.index);
1160
+ if (before.trim()) {
1161
+ segments.push(...parseMarkdownWithCodeBlocks(before));
1162
+ }
1163
+ const g = match.groups ?? {};
1164
+ if (g.reflect || g.reflectUnclosed) {
1165
+ const prompt = (g.reflectClosed ?? g.reflectOpen ?? "").trim();
1166
+ if (prompt) segments.push({ type: "reflect", prompt });
1167
+ } else if (g.bloom || g.bloomUnclosed) {
1168
+ const level = g.bloomLevel ?? g.bloomLevelUn;
1169
+ const bloomContent = g.bloomClosed ?? g.bloomOpen ?? "";
1170
+ if (level && bloomContent) {
1171
+ const qMatch = bloomContent.match(/<question>([\s\S]*?)<\/question>/i);
1172
+ const aMatch = bloomContent.match(/<answer>([\s\S]*?)<\/answer>/i);
1173
+ if (qMatch && aMatch) {
1174
+ segments.push({ type: "bloom", level, question: qMatch[1].trim(), answer: aMatch[1].trim() });
1175
+ } else if (qMatch) {
1176
+ segments.push({ type: "bloom", level, question: qMatch[1].trim(), answer: "(Answer not provided)" });
1177
+ } else {
1178
+ const clean = bloomContent.replace(/^\*\*Question\s*\d*:?\*\*\s*/i, "").replace(/^\*\*Q\d*:?\*\*\s*/i, "").trim();
1179
+ if (clean) segments.push({ type: "bloom", level, question: clean, answer: "(See answers section below)" });
1180
+ }
1181
+ }
1182
+ } else if (g.quiz) {
1183
+ segments.push({ type: "quiz", question: g.quizQuestion.trim(), answer: g.quizAnswer.trim() });
1184
+ } else if (g.visualize) {
1185
+ segments.push({
1186
+ type: "visualization",
1187
+ visualizationType: g.vizType,
1188
+ description: g.vizDesc ?? ""
1189
+ });
1190
+ }
1191
+ lastIndex = tagRegex.lastIndex;
1192
+ }
1193
+ const remaining = content.slice(lastIndex);
1194
+ if (remaining.trim()) segments.push(...parseMarkdownWithCodeBlocks(remaining));
1195
+ return segments;
1196
+ }
1197
+
1198
+ export { EDITOR_MOTIONS, EDITOR_OPERATORS, ENTER_SLOT_CLASS, INDENT_UNIT, MAX_ENTER_DELAY, Presence, applyMotion, applyOperator, arrowheadPath, asEnterAnimation, brainIconPath, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, computeLineDiff, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, eightPointedStarPath, enterClassName, gearTeethPath, getAllTicks, getAllTraits, getDebugEvents, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getRecentEvents, getRecentGuardEvaluations, getTick, getTrait, initDebugShortcut, isDebugEnabled, isDebugEnabled2, isEditorMotion, isEditorOperator, isMotionEnabled, lockIconPath, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, motionRange, onDebugToggle, parseContentSegments, parseLessonSegments, parseMarkdownWithCodeBlocks, parseMarkdownWithCodeBlocks2, pipeIconPath, profilerOnRender, recordGuardEvaluation, registerTick, registerTrait, resolveImageUrl, setDebugEnabled, setEntityProvider, setTickActive, slotPlaysDefaultEnter, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, toggleDebug, unregisterTick, unregisterTrait, updateGuardResult, updateTickExecution, updateTraitState, usePerfBuffer, usePresence, useSlotEnterRestart };
@@ -357,8 +357,8 @@ var en_default = {
357
357
  "avl.emits": "emits {{event}}",
358
358
  "avl.pageLayout": "Page Layout",
359
359
  "avl.overlaySuffix": "(overlay)",
360
- "avl.stateCount": "{{count}} states",
361
- "avl.transitionCount": "{{count}} transitions",
360
+ "avl.stateCount": "states: {{count}}",
361
+ "avl.transitionCount": "transitions: {{count}}",
362
362
  "avl.listensRail": "listens",
363
363
  "avl.emitsRail": "emits",
364
364
  "avl.now": "now",
@@ -945,6 +945,9 @@ var en_default = {
945
945
  "propertyInspector.tier.infra": "infra",
946
946
  "propertyInspector.tier.internal": "internal",
947
947
  "upload.error.readFailed": "Could not read the selected file",
948
+ "selection.ask": "Ask",
949
+ "selection.note": "Note",
950
+ "selection.toolbar": "Selection actions",
948
951
  "qrScanner.apiUnavailable": "Camera API not available in this environment",
949
952
  "themeToggle.switchToLight": "Switch to light mode",
950
953
  "themeToggle.switchToDark": "Switch to dark mode",
@@ -1239,7 +1242,19 @@ var en_default = {
1239
1242
  "agentChat.copied": "Copied",
1240
1243
  "agentChat.today": "Today",
1241
1244
  "agentChat.yesterday": "Yesterday",
1242
- "agentChat.emptyDescription": "Ask in your own words \u2014 the assistant can look things up and make changes for you."
1245
+ "agentChat.emptyDescription": "Ask in your own words \u2014 the assistant can look things up and make changes for you.",
1246
+ "avl.effectCategory.ui": "Screen \u2014 changes what the user sees",
1247
+ "avl.effectCategory.data": "Data \u2014 reads, changes or saves records",
1248
+ "avl.effectCategory.communication": "Messages \u2014 sends an event, a notification or a request",
1249
+ "avl.effectCategory.lifecycle": "Lifecycle \u2014 starts or removes running instances",
1250
+ "avl.effectCategory.control": "Flow \u2014 decides what runs next",
1251
+ "avl.effectCategory.async": "Timing \u2014 waits, delays or runs things together",
1252
+ "avl.effectCategory.compute": "Compute \u2014 runs a model or a calculation",
1253
+ "avl.effectCategory.system": "System \u2014 works with the platform and its tools",
1254
+ "avl.stateInitial": "start",
1255
+ "avl.stateTerminal": "end",
1256
+ "avl.guardCaption": "The transition only fires when this check is true.",
1257
+ "avl.effectsCaption": "What runs, in order, when the transition fires."
1243
1258
  };
1244
1259
 
1245
1260
  export { en_default };
@@ -1,5 +1,5 @@
1
- import { beginPending, endPending } from './chunk-JRW33U35.js';
2
- import { useEventBus } from './chunk-6EV3OEBQ.js';
1
+ import { beginPending, endPending } from './chunk-I5QOYW2Z.js';
2
+ import { useEventBus } from './chunk-CHNC4UYE.js';
3
3
  import { useState, useCallback, useEffect, useMemo, useRef } from 'react';
4
4
  import { createLogger } from '@almadar/logger';
5
5
  export { useNavStack } from '@almadar/ui/providers';
@@ -1,11 +1,15 @@
1
- import { DEFAULT_CURRENCY } from './chunk-RNY5LJXJ.js';
2
- import { en_default } from './chunk-HRCR53OW.js';
1
+ import { ar_default, sl_default } from './chunk-YYYHH5BA.js';
2
+ import { DEFAULT_CURRENCY } from './chunk-723MJUU3.js';
3
+ import { en_default } from './chunk-LZRW6GXG.js';
3
4
  import React, { createContext, useEffect, useContext, useMemo, useRef, useSyncExternalStore } from 'react';
4
5
  import { mergeEntityFrame } from '@almadar/core';
5
6
  import { createLogger } from '@almadar/logger';
6
7
 
7
8
  var { $meta: _meta, ...coreMessages } = en_default;
8
9
  var coreLocale = coreMessages;
10
+ var { $meta: _arMeta, ...arMessages } = ar_default;
11
+ var { $meta: _slMeta, ...slMessages } = sl_default;
12
+ var uiLocales = { en: coreLocale, ar: arMessages, sl: slMessages };
9
13
  var I18nContext = createContext({
10
14
  locale: "en",
11
15
  direction: "ltr",
@@ -42,9 +46,10 @@ function useFormatContext() {
42
46
  [t, locale, currency]
43
47
  );
44
48
  }
45
- function createTranslate(messages) {
49
+ function createTranslate(messages, locale) {
50
+ const uiCatalog = locale !== void 0 ? uiLocales[locale] : void 0;
46
51
  return (key, params) => {
47
- let msg = messages[key] ?? coreLocale[key] ?? key;
52
+ let msg = messages[key] ?? uiCatalog?.[key] ?? coreLocale[key] ?? key;
48
53
  if (params) {
49
54
  for (const [k, v] of Object.entries(params)) {
50
55
  msg = msg.split(`{{${k}}}`).join(String(v));