@almadar/ui 6.58.0 → 6.61.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 (94) hide show
  1. package/dist/BehaviorValueFrame-3ORZHPWQ.css +1252 -0
  2. package/dist/BehaviorValueFrame-QTD7BWOI.js +18 -0
  3. package/dist/{Canvas3DHost-BTvRPfsr.d.ts → Canvas3DHost-CNjANoaU.d.ts} +1 -1
  4. package/dist/{GameAudioProvider-kXbonWTv.d.ts → GameAudioProvider-Dv_L-PHt.d.ts} +1 -1
  5. package/dist/TraitValueFrame-2WMYJOA5.css +1252 -0
  6. package/dist/TraitValueFrame-WOXNLLMM.js +17 -0
  7. package/dist/Typography-BY4A2NBY.js +5 -0
  8. package/dist/{UISlotRenderer-N5DFYE6K.js → UISlotRenderer-EEOXSJCI.js} +10 -8
  9. package/dist/avl/index.cjs +31960 -27831
  10. package/dist/avl/index.d.ts +36 -13
  11. package/dist/avl/index.js +331 -6147
  12. package/dist/{avl-3d-context-BpBKZIbc.d.ts → avl-3d-context-Dxun3-ri.d.ts} +2 -0
  13. package/dist/{chunk-I2ZNE5TD.js → chunk-6PV4LASE.js} +9495 -639
  14. package/dist/{chunk-723MJUU3.js → chunk-6ZCU3BQN.js} +1 -1
  15. package/dist/{chunk-GZGDBS4S.js → chunk-7NIU5GDC.js} +2 -2
  16. package/dist/{chunk-YYYHH5BA.js → chunk-CB64IOYD.js} +0 -4
  17. package/dist/{chunk-MZIDOJMD.js → chunk-EIIQGOZW.js} +2 -1
  18. package/dist/chunk-F7NZ3KZQ.js +434 -0
  19. package/dist/{chunk-LZRW6GXG.js → chunk-FYX64CDL.js} +0 -2
  20. package/dist/{chunk-4ZGXIW3B.js → chunk-KZRAMPM6.js} +1 -1
  21. package/dist/{chunk-VHTJRS2N.js → chunk-L3MTZ3RH.js} +7 -0
  22. package/dist/chunk-LUREMDI3.js +49 -0
  23. package/dist/{chunk-HA7CJWQX.js → chunk-MGN6B6OQ.js} +1477 -1177
  24. package/dist/{chunk-Q47ZN2DW.js → chunk-N23SVGTH.js} +83 -1
  25. package/dist/{chunk-KJGVLXEN.js → chunk-N4IJS5DD.js} +50 -116
  26. package/dist/{chunk-I5QOYW2Z.js → chunk-UTSDPJUP.js} +205 -2
  27. package/dist/{chunk-V3FGTQUE.js → chunk-ZR45FGW3.js} +7 -1
  28. package/dist/{cn-DIql5232.d.ts → cn-CDIhHCUC.d.ts} +40 -16
  29. package/dist/components/index.cjs +14455 -4099
  30. package/dist/components/index.d.ts +165 -177
  31. package/dist/components/index.js +14 -15
  32. package/dist/context/index.cjs +16 -1
  33. package/dist/context/index.js +4 -2
  34. package/dist/hooks/index.cjs +79 -6
  35. package/dist/hooks/index.d.ts +43 -2
  36. package/dist/hooks/index.js +6 -7
  37. package/dist/lib/drawable/three/index.cjs +350 -26
  38. package/dist/lib/drawable/three/index.d.ts +5 -5
  39. package/dist/lib/drawable/three/index.js +28 -7
  40. package/dist/lib/index.cjs +90 -4
  41. package/dist/lib/index.d.ts +3 -3
  42. package/dist/lib/index.js +74 -6
  43. package/dist/locales/index.cjs +0 -6
  44. package/dist/locales/index.js +2 -2
  45. package/dist/{paintDispatch-BN8Vbzgs.d.ts → paintDispatch-Cp1_S93j.d.ts} +30 -2
  46. package/dist/providers/index.cjs +13853 -1075
  47. package/dist/providers/index.d.ts +38 -6
  48. package/dist/providers/index.js +40 -30
  49. package/dist/runtime/index.cjs +28369 -18287
  50. package/dist/runtime/index.d.ts +65 -3
  51. package/dist/runtime/index.js +13 -379
  52. package/dist/ssr/index.cjs +508 -133
  53. package/dist/ssr/index.d.cts +56 -4
  54. package/dist/ssr/index.d.ts +56 -4
  55. package/dist/ssr/index.js +446 -71
  56. package/dist/{verificationRegistry-CK76GUfH.d.ts → verificationRegistry-B5aGl7WF.d.ts} +3 -2
  57. package/locales/ar.json +0 -2
  58. package/locales/en.json +0 -2
  59. package/locales/sl.json +0 -2
  60. package/package.json +7 -7
  61. package/tailwind-preset.cjs +78 -8
  62. package/themes/_contract.md +6 -0
  63. package/themes/_fonts.css +4 -4
  64. package/themes/_foundation.css +11 -0
  65. package/themes/_presets.css +2 -0
  66. package/themes/almadar-website.css +10 -0
  67. package/themes/almadar.css +10 -0
  68. package/themes/atelier.css +10 -0
  69. package/themes/bauhaus.css +10 -0
  70. package/themes/bloomberg-dense.css +10 -0
  71. package/themes/clay.css +10 -0
  72. package/themes/corporate.css +10 -0
  73. package/themes/gazette.css +10 -0
  74. package/themes/glass.css +10 -0
  75. package/themes/kflow.css +5 -0
  76. package/themes/kiosk.css +10 -0
  77. package/themes/linear-clean.css +10 -0
  78. package/themes/material.css +10 -0
  79. package/themes/minimalist.css +10 -0
  80. package/themes/nata.css +304 -0
  81. package/themes/neon.css +10 -0
  82. package/themes/notion-editorial.css +10 -0
  83. package/themes/orb.css +10 -0
  84. package/themes/prism.css +10 -0
  85. package/themes/rawi.css +304 -0
  86. package/themes/retro.css +10 -0
  87. package/themes/risograph.css +10 -0
  88. package/themes/scandi.css +10 -0
  89. package/themes/solarpunk.css +10 -0
  90. package/themes/terminal.css +138 -128
  91. package/dist/Typography-LZTP72Y4.js +0 -5
  92. package/dist/chunk-D2E44ODB.js +0 -350
  93. package/dist/chunk-HB3D3HUJ.js +0 -2265
  94. package/dist/chunk-N7JIG57B.js +0 -138
@@ -1,138 +0,0 @@
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';
4
- import React, { createContext, useEffect, useContext, useMemo, useRef, useSyncExternalStore } from 'react';
5
- import { mergeEntityFrame } from '@almadar/core';
6
- import { createLogger } from '@almadar/logger';
7
-
8
- var { $meta: _meta, ...coreMessages } = en_default;
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 };
13
- var I18nContext = createContext({
14
- locale: "en",
15
- direction: "ltr",
16
- t: (key, params) => {
17
- let msg = coreLocale[key] ?? key;
18
- if (params) {
19
- for (const [k, v] of Object.entries(params)) {
20
- msg = msg.split(`{{${k}}}`).join(String(v));
21
- }
22
- }
23
- return msg;
24
- }
25
- });
26
- I18nContext.displayName = "I18nContext";
27
- function I18nProvider({ value, children, documentRoot }) {
28
- useEffect(() => {
29
- if (!documentRoot) return;
30
- document.documentElement.lang = value.locale;
31
- document.documentElement.dir = value.direction;
32
- }, [documentRoot, value.locale, value.direction]);
33
- return React.createElement(I18nContext.Provider, { value }, children);
34
- }
35
- function useTranslate() {
36
- return useContext(I18nContext);
37
- }
38
- function useRenderI18n() {
39
- const { locale, messages } = useContext(I18nContext);
40
- return useMemo(() => messages !== void 0 ? { locale, messages } : void 0, [locale, messages]);
41
- }
42
- function useFormatContext() {
43
- const { t, locale, currency } = useContext(I18nContext);
44
- return useMemo(
45
- () => ({ locale, currency: currency ?? DEFAULT_CURRENCY, booleanLabels: { yes: t("common.yes"), no: t("common.no") } }),
46
- [t, locale, currency]
47
- );
48
- }
49
- function createTranslate(messages, locale) {
50
- const uiCatalog = locale !== void 0 ? uiLocales[locale] : void 0;
51
- return (key, params) => {
52
- let msg = messages[key] ?? uiCatalog?.[key] ?? coreLocale[key] ?? key;
53
- if (params) {
54
- for (const [k, v] of Object.entries(params)) {
55
- msg = msg.split(`{{${k}}}`).join(String(v));
56
- }
57
- }
58
- return msg;
59
- };
60
- }
61
- var log = createLogger("almadar:ui:shared-entity-store");
62
- var EMPTY_ENTITY_STATE = {};
63
- function createSharedEntityStore() {
64
- const states = /* @__PURE__ */ new Map();
65
- const subscribers = /* @__PURE__ */ new Map();
66
- const getSnapshot = (entityId) => states.get(entityId) ?? EMPTY_ENTITY_STATE;
67
- const subscribe = (entityId, callback) => {
68
- let set = subscribers.get(entityId);
69
- if (!set) {
70
- set = /* @__PURE__ */ new Set();
71
- subscribers.set(entityId, set);
72
- }
73
- set.add(callback);
74
- return () => {
75
- const current = subscribers.get(entityId);
76
- if (!current) return;
77
- current.delete(callback);
78
- if (current.size === 0) {
79
- subscribers.delete(entityId);
80
- }
81
- };
82
- };
83
- const commit = (entityId, nextState) => {
84
- states.set(entityId, nextState);
85
- const set = subscribers.get(entityId);
86
- if (!set) return;
87
- set.forEach((callback) => {
88
- try {
89
- callback();
90
- } catch (error) {
91
- log.error("Shared entity subscriber error", {
92
- entityId,
93
- error: error instanceof Error ? error : String(error)
94
- });
95
- }
96
- });
97
- };
98
- const seed = (entityId, initialState) => {
99
- if (!states.has(entityId)) {
100
- states.set(entityId, initialState);
101
- }
102
- };
103
- return { getSnapshot, subscribe, commit, seed };
104
- }
105
- function useSharedEntityStore() {
106
- const storeRef = useRef(null);
107
- if (storeRef.current === null) {
108
- storeRef.current = createSharedEntityStore();
109
- }
110
- return storeRef.current;
111
- }
112
- var SharedEntityStoreContext = createContext(null);
113
- function useSharedEntityStoreContext() {
114
- const store = useContext(SharedEntityStoreContext);
115
- if (!store) {
116
- throw new Error(
117
- "useSharedEntityStoreContext: no SharedEntityStoreContext.Provider found in the component tree"
118
- );
119
- }
120
- return store;
121
- }
122
- function useSharedEntitySnapshot(store, entityId) {
123
- return useSyncExternalStore(
124
- (onStoreChange) => store.subscribe(entityId, onStoreChange),
125
- () => store.getSnapshot(entityId)
126
- );
127
- }
128
- function runTickFrame(entityId, orderedWriters, store) {
129
- let scratch = store.getSnapshot(entityId);
130
- for (const writer of orderedWriters) {
131
- const writes = writer(scratch);
132
- scratch = mergeEntityFrame(scratch, writes);
133
- }
134
- store.commit(entityId, scratch);
135
- return scratch;
136
- }
137
-
138
- export { I18nProvider, SharedEntityStoreContext, createSharedEntityStore, createTranslate, runTickFrame, useFormatContext, useRenderI18n, useSharedEntitySnapshot, useSharedEntityStore, useSharedEntityStoreContext, useTranslate };