@monimesl/dot-renderer-react 0.1.0-alpha.2 → 0.1.0-alpha.23

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 (267) hide show
  1. package/README.md +43 -1
  2. package/dist/LICENSE-PHOSPHOR +21 -0
  3. package/dist/_virtual/_rolldown/runtime.js +14 -0
  4. package/dist/_virtual/builtin_esm-external-require-react.js +9 -0
  5. package/dist/color.js +94 -0
  6. package/dist/components/amount-input.d.ts +6 -0
  7. package/dist/components/amount-input.js +111 -0
  8. package/dist/components/avatar.d.ts +6 -0
  9. package/dist/components/avatar.js +68 -0
  10. package/dist/components/box.js +56 -0
  11. package/dist/components/button.d.ts +6 -0
  12. package/dist/components/button.js +42 -0
  13. package/dist/components/carousel.d.ts +6 -0
  14. package/dist/components/carousel.js +258 -0
  15. package/dist/components/chip.d.ts +6 -0
  16. package/dist/components/chip.js +41 -0
  17. package/dist/components/code-input.d.ts +6 -0
  18. package/dist/components/code-input.js +96 -0
  19. package/dist/components/detail-row.d.ts +6 -0
  20. package/dist/components/detail-row.js +40 -0
  21. package/dist/components/disclosure.d.ts +6 -0
  22. package/dist/components/disclosure.js +76 -0
  23. package/dist/components/divider.d.ts +6 -0
  24. package/dist/components/divider.js +18 -0
  25. package/dist/components/empty-state.d.ts +6 -0
  26. package/dist/components/empty-state.js +64 -0
  27. package/dist/components/feedback.d.ts +8 -0
  28. package/dist/components/feedback.js +101 -0
  29. package/dist/components/field-box.js +44 -0
  30. package/dist/components/field.js +43 -0
  31. package/dist/components/footer.d.ts +6 -0
  32. package/dist/components/footer.js +24 -0
  33. package/dist/components/grid.d.ts +7 -0
  34. package/dist/components/grid.js +97 -0
  35. package/dist/components/https.js +11 -0
  36. package/dist/components/icon-artwork.js +143 -0
  37. package/dist/components/icon-button.js +28 -0
  38. package/dist/components/icon-svg.js +27 -0
  39. package/dist/components/icon.d.ts +6 -0
  40. package/dist/components/icon.js +25 -0
  41. package/dist/components/image.d.ts +6 -0
  42. package/dist/components/image.js +40 -0
  43. package/dist/components/index.d.ts +38 -0
  44. package/dist/components/index.js +92 -0
  45. package/dist/components/input.d.ts +6 -0
  46. package/dist/components/input.js +108 -0
  47. package/dist/components/link.d.ts +6 -0
  48. package/dist/components/link.js +32 -0
  49. package/dist/components/list.d.ts +7 -0
  50. package/dist/components/list.js +143 -0
  51. package/dist/components/numbers.js +9 -0
  52. package/dist/components/option-place.js +9 -0
  53. package/dist/components/option.d.ts +6 -0
  54. package/dist/components/option.js +44 -0
  55. package/dist/components/padding.d.ts +2 -0
  56. package/dist/components/padding.js +30 -0
  57. package/dist/components/pressable.js +17 -0
  58. package/dist/components/prose-context.js +5 -0
  59. package/dist/components/prose.d.ts +9 -0
  60. package/dist/components/prose.js +67 -0
  61. package/dist/components/qr-code.d.ts +6 -0
  62. package/dist/components/qr-code.js +58 -0
  63. package/dist/components/rich-text.d.ts +6 -0
  64. package/dist/components/rich-text.js +73 -0
  65. package/dist/components/scroll.d.ts +6 -0
  66. package/dist/components/scroll.js +57 -0
  67. package/dist/components/select.d.ts +6 -0
  68. package/dist/components/select.js +93 -0
  69. package/dist/components/sheet.d.ts +8 -0
  70. package/dist/components/sheet.js +106 -0
  71. package/dist/components/skeleton.d.ts +6 -0
  72. package/dist/components/skeleton.js +55 -0
  73. package/dist/components/slider.d.ts +6 -0
  74. package/dist/components/slider.js +57 -0
  75. package/dist/components/spinner.d.ts +6 -0
  76. package/dist/components/spinner.js +48 -0
  77. package/dist/components/stack.d.ts +6 -0
  78. package/dist/components/stack.js +25 -0
  79. package/dist/components/stepper.d.ts +6 -0
  80. package/dist/components/stepper.js +92 -0
  81. package/dist/components/steps.d.ts +7 -0
  82. package/dist/components/steps.js +110 -0
  83. package/dist/components/tabs.d.ts +7 -0
  84. package/dist/components/tabs.js +95 -0
  85. package/dist/components/text-area.d.ts +6 -0
  86. package/dist/components/text-area.js +42 -0
  87. package/dist/components/text.d.ts +6 -0
  88. package/dist/components/text.js +107 -0
  89. package/dist/components/toast.d.ts +6 -0
  90. package/dist/components/toast.js +56 -0
  91. package/dist/components/toggles.d.ts +9 -0
  92. package/dist/components/toggles.js +148 -0
  93. package/dist/components/tokens.js +49 -0
  94. package/dist/components/tones.js +30 -0
  95. package/dist/components/typed-text.js +28 -0
  96. package/dist/components/view.d.ts +6 -0
  97. package/dist/components/view.js +54 -0
  98. package/dist/index.d.ts +43 -44
  99. package/dist/index.js +40 -318
  100. package/dist/markdown.js +230 -0
  101. package/dist/page-root.d.ts +2 -0
  102. package/dist/page-root.js +20 -0
  103. package/dist/portal.js +8 -0
  104. package/dist/pull-to-refresh.js +120 -0
  105. package/dist/react-host/19.3.0/react-dom.js +3 -0
  106. package/dist/react-host/19.3.0/react-host.js +6 -6
  107. package/dist/renderer.d.ts +17 -0
  108. package/dist/renderer.js +33 -0
  109. package/dist/root.d.ts +10 -0
  110. package/dist/root.js +68 -0
  111. package/dist/styles.css +1 -0
  112. package/dist/theme.d.ts +26 -0
  113. package/dist/theme.js +129 -0
  114. package/dist/types.d.ts +7 -0
  115. package/dist/vendor/@base-ui/react/checkbox/indicator/CheckboxIndicator.js +51 -0
  116. package/dist/vendor/@base-ui/react/checkbox/root/CheckboxRoot.js +265 -0
  117. package/dist/vendor/@base-ui/react/checkbox/root/CheckboxRootContext.js +13 -0
  118. package/dist/vendor/@base-ui/react/checkbox/root/CheckboxRootDataAttributes.js +11 -0
  119. package/dist/vendor/@base-ui/react/checkbox/utils/getCheckboxStateAttributesMapping.js +15 -0
  120. package/dist/vendor/@base-ui/react/checkbox-group/CheckboxGroupContext.js +10 -0
  121. package/dist/vendor/@base-ui/react/dialog/backdrop/DialogBackdrop.js +40 -0
  122. package/dist/vendor/@base-ui/react/dialog/close/DialogClose.js +39 -0
  123. package/dist/vendor/@base-ui/react/dialog/popup/DialogPopup.js +92 -0
  124. package/dist/vendor/@base-ui/react/dialog/popup/DialogPopupCssVars.js +8 -0
  125. package/dist/vendor/@base-ui/react/dialog/popup/DialogPopupDataAttributes.js +7 -0
  126. package/dist/vendor/@base-ui/react/dialog/portal/DialogPortal.js +38 -0
  127. package/dist/vendor/@base-ui/react/dialog/portal/DialogPortalContext.js +13 -0
  128. package/dist/vendor/@base-ui/react/dialog/root/DialogRoot.js +16 -0
  129. package/dist/vendor/@base-ui/react/dialog/root/DialogRootContext.js +13 -0
  130. package/dist/vendor/@base-ui/react/dialog/root/useDialogRoot.js +77 -0
  131. package/dist/vendor/@base-ui/react/dialog/root/useRenderDialogRoot.js +65 -0
  132. package/dist/vendor/@base-ui/react/dialog/store/DialogStore.js +70 -0
  133. package/dist/vendor/@base-ui/react/dialog/title/DialogTitle.js +25 -0
  134. package/dist/vendor/@base-ui/react/dialog/utils/stateAttributesMapping.js +17 -0
  135. package/dist/vendor/@base-ui/react/field/control/FieldControlDataAttributes.js +11 -0
  136. package/dist/vendor/@base-ui/react/field/item/FieldItemContext.js +10 -0
  137. package/dist/vendor/@base-ui/react/field/root/useFieldValidation.js +18 -0
  138. package/dist/vendor/@base-ui/react/fieldset/root/FieldsetRootContext.js +13 -0
  139. package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingFocusManager.js +477 -0
  140. package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingPortal.js +165 -0
  141. package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingRootStore.js +65 -0
  142. package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingTree.js +22 -0
  143. package/dist/vendor/@base-ui/react/floating-ui-react/hooks/useDismiss.js +373 -0
  144. package/dist/vendor/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.js +58 -0
  145. package/dist/vendor/@base-ui/react/floating-ui-react/utils/composite.js +40 -0
  146. package/dist/vendor/@base-ui/react/floating-ui-react/utils/constants.js +5 -0
  147. package/dist/vendor/@base-ui/react/floating-ui-react/utils/createAttribute.js +6 -0
  148. package/dist/vendor/@base-ui/react/floating-ui-react/utils/createEventEmitter.js +18 -0
  149. package/dist/vendor/@base-ui/react/floating-ui-react/utils/element.js +26 -0
  150. package/dist/vendor/@base-ui/react/floating-ui-react/utils/enqueueFocus.js +25 -0
  151. package/dist/vendor/@base-ui/react/floating-ui-react/utils/event.js +25 -0
  152. package/dist/vendor/@base-ui/react/floating-ui-react/utils/markOthers.js +116 -0
  153. package/dist/vendor/@base-ui/react/floating-ui-react/utils/nodes.js +16 -0
  154. package/dist/vendor/@base-ui/react/floating-ui-react/utils/tabbable.js +135 -0
  155. package/dist/vendor/@base-ui/react/internals/TransitionStatusDataAttributes.js +11 -0
  156. package/dist/vendor/@base-ui/react/internals/composite/composite.js +89 -0
  157. package/dist/vendor/@base-ui/react/internals/composite/constants.js +4 -0
  158. package/dist/vendor/@base-ui/react/internals/composite/item/CompositeItem.js +21 -0
  159. package/dist/vendor/@base-ui/react/internals/composite/item/useCompositeItem.js +31 -0
  160. package/dist/vendor/@base-ui/react/internals/composite/list/CompositeList.js +180 -0
  161. package/dist/vendor/@base-ui/react/internals/composite/list/CompositeListContext.js +15 -0
  162. package/dist/vendor/@base-ui/react/internals/composite/list/useCompositeListItem.js +54 -0
  163. package/dist/vendor/@base-ui/react/internals/composite/root/CompositeRoot.js +62 -0
  164. package/dist/vendor/@base-ui/react/internals/composite/root/CompositeRootContext.js +13 -0
  165. package/dist/vendor/@base-ui/react/internals/composite/root/useCompositeRoot.js +170 -0
  166. package/dist/vendor/@base-ui/react/internals/constants.js +18 -0
  167. package/dist/vendor/@base-ui/react/internals/createBaseUIEventDetails.js +40 -0
  168. package/dist/vendor/@base-ui/react/internals/direction-context/DirectionContext.js +10 -0
  169. package/dist/vendor/@base-ui/react/internals/field-constants/constants.js +33 -0
  170. package/dist/vendor/@base-ui/react/internals/field-register-control/useRegisterFieldControl.js +40 -0
  171. package/dist/vendor/@base-ui/react/internals/field-root-context/FieldRootContext.js +45 -0
  172. package/dist/vendor/@base-ui/react/internals/form-context/FormContext.js +18 -0
  173. package/dist/vendor/@base-ui/react/internals/getStateAttributesProps.js +17 -0
  174. package/dist/vendor/@base-ui/react/internals/labelable-provider/LabelableContext.js +24 -0
  175. package/dist/vendor/@base-ui/react/internals/labelable-provider/useAriaLabelledBy.js +35 -0
  176. package/dist/vendor/@base-ui/react/internals/labelable-provider/useLabelableId.js +57 -0
  177. package/dist/vendor/@base-ui/react/internals/reason-parts.js +14 -0
  178. package/dist/vendor/@base-ui/react/internals/serializeValue.js +12 -0
  179. package/dist/vendor/@base-ui/react/internals/stateAttributesMapping.js +11 -0
  180. package/dist/vendor/@base-ui/react/internals/use-button/useButton.js +137 -0
  181. package/dist/vendor/@base-ui/react/internals/useAnimationsFinished.js +94 -0
  182. package/dist/vendor/@base-ui/react/internals/useBaseUiId.js +13 -0
  183. package/dist/vendor/@base-ui/react/internals/useOpenChangeComplete.js +28 -0
  184. package/dist/vendor/@base-ui/react/internals/useRenderElement.js +109 -0
  185. package/dist/vendor/@base-ui/react/internals/useTransitionStatus.js +70 -0
  186. package/dist/vendor/@base-ui/react/internals/useValueChanged.js +15 -0
  187. package/dist/vendor/@base-ui/react/merge-props/mergeProps.js +153 -0
  188. package/dist/vendor/@base-ui/react/radio/indicator/RadioIndicator.js +46 -0
  189. package/dist/vendor/@base-ui/react/radio/root/RadioRoot.js +179 -0
  190. package/dist/vendor/@base-ui/react/radio/root/RadioRootContext.js +13 -0
  191. package/dist/vendor/@base-ui/react/radio/root/RadioRootDataAttributes.js +11 -0
  192. package/dist/vendor/@base-ui/react/radio/utils/stateAttributesMapping.js +14 -0
  193. package/dist/vendor/@base-ui/react/radio-group/RadioGroup.js +170 -0
  194. package/dist/vendor/@base-ui/react/radio-group/RadioGroupContext.js +10 -0
  195. package/dist/vendor/@base-ui/react/switch/root/SwitchRoot.js +170 -0
  196. package/dist/vendor/@base-ui/react/switch/root/SwitchRootContext.js +13 -0
  197. package/dist/vendor/@base-ui/react/switch/root/SwitchRootDataAttributes.js +11 -0
  198. package/dist/vendor/@base-ui/react/switch/stateAttributesMapping.js +12 -0
  199. package/dist/vendor/@base-ui/react/switch/thumb/SwitchThumb.js +25 -0
  200. package/dist/vendor/@base-ui/react/tabs/list/TabsList.js +98 -0
  201. package/dist/vendor/@base-ui/react/tabs/list/TabsListContext.js +13 -0
  202. package/dist/vendor/@base-ui/react/tabs/root/TabsRoot.js +213 -0
  203. package/dist/vendor/@base-ui/react/tabs/root/TabsRootContext.js +16 -0
  204. package/dist/vendor/@base-ui/react/tabs/root/TabsRootDataAttributes.js +8 -0
  205. package/dist/vendor/@base-ui/react/tabs/root/stateAttributesMapping.js +5 -0
  206. package/dist/vendor/@base-ui/react/tabs/tab/TabsTab.js +137 -0
  207. package/dist/vendor/@base-ui/react/utils/CommonPopupDataAttributes.js +24 -0
  208. package/dist/vendor/@base-ui/react/utils/CommonTriggerDataAttributes.js +11 -0
  209. package/dist/vendor/@base-ui/react/utils/FocusGuard.js +32 -0
  210. package/dist/vendor/@base-ui/react/utils/InternalBackdrop.js +30 -0
  211. package/dist/vendor/@base-ui/react/utils/dispatchClickWithModifiers.js +25 -0
  212. package/dist/vendor/@base-ui/react/utils/popupStateMapping.js +22 -0
  213. package/dist/vendor/@base-ui/react/utils/popups/popupStoreUtils.js +247 -0
  214. package/dist/vendor/@base-ui/react/utils/popups/popupTriggerMap.js +96 -0
  215. package/dist/vendor/@base-ui/react/utils/popups/store.js +94 -0
  216. package/dist/vendor/@base-ui/react/utils/resolveClassName.js +13 -0
  217. package/dist/vendor/@base-ui/react/utils/resolveRef.js +11 -0
  218. package/dist/vendor/@base-ui/react/utils/resolveStyle.js +13 -0
  219. package/dist/vendor/@base-ui/react/utils/useFocusableWhenDisabled.js +30 -0
  220. package/dist/vendor/@base-ui/utils/addEventListener.js +12 -0
  221. package/dist/vendor/@base-ui/utils/createLogOnce.js +20 -0
  222. package/dist/vendor/@base-ui/utils/empty.js +6 -0
  223. package/dist/vendor/@base-ui/utils/error.js +5 -0
  224. package/dist/vendor/@base-ui/utils/fastHooks.js +68 -0
  225. package/dist/vendor/@base-ui/utils/formatErrorMessage.js +27 -0
  226. package/dist/vendor/@base-ui/utils/getDefaultFormSubmitter.js +25 -0
  227. package/dist/vendor/@base-ui/utils/getReactElementRef.js +14 -0
  228. package/dist/vendor/@base-ui/utils/inertValue.js +8 -0
  229. package/dist/vendor/@base-ui/utils/isElementDisabled.js +6 -0
  230. package/dist/vendor/@base-ui/utils/mergeCleanups.js +14 -0
  231. package/dist/vendor/@base-ui/utils/mergeObjects.js +11 -0
  232. package/dist/vendor/@base-ui/utils/owner.js +7 -0
  233. package/dist/vendor/@base-ui/utils/platform/engine.js +8 -0
  234. package/dist/vendor/@base-ui/utils/platform/env.js +6 -0
  235. package/dist/vendor/@base-ui/utils/platform/os.js +15 -0
  236. package/dist/vendor/@base-ui/utils/platform/screen-reader.js +9 -0
  237. package/dist/vendor/@base-ui/utils/platform/shared.js +36 -0
  238. package/dist/vendor/@base-ui/utils/reactVersion.js +8 -0
  239. package/dist/vendor/@base-ui/utils/safeReact.js +13 -0
  240. package/dist/vendor/@base-ui/utils/shadowDom.js +26 -0
  241. package/dist/vendor/@base-ui/utils/store/ReactStore.js +181 -0
  242. package/dist/vendor/@base-ui/utils/store/Store.js +102 -0
  243. package/dist/vendor/@base-ui/utils/store/useStore.js +97 -0
  244. package/dist/vendor/@base-ui/utils/useAnimationFrame.js +87 -0
  245. package/dist/vendor/@base-ui/utils/useControlled.js +52 -0
  246. package/dist/vendor/@base-ui/utils/useId.js +32 -0
  247. package/dist/vendor/@base-ui/utils/useIsoLayoutEffect.js +7 -0
  248. package/dist/vendor/@base-ui/utils/useMergedRefs.js +87 -0
  249. package/dist/vendor/@base-ui/utils/useOnMount.js +12 -0
  250. package/dist/vendor/@base-ui/utils/useRefWithInit.js +18 -0
  251. package/dist/vendor/@base-ui/utils/useScrollLock.js +206 -0
  252. package/dist/vendor/@base-ui/utils/useStableCallback.js +38 -0
  253. package/dist/vendor/@base-ui/utils/useTimeout.js +43 -0
  254. package/dist/vendor/@base-ui/utils/useValueAsRef.js +27 -0
  255. package/dist/vendor/@base-ui/utils/visuallyHidden.js +23 -0
  256. package/dist/vendor/@base-ui/utils/warn.js +5 -0
  257. package/dist/vendor/@floating-ui/utils/dist/floating-ui.utils.dom.js +49 -0
  258. package/dist/vendor/uqr/dist/index.js +858 -0
  259. package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +74 -0
  260. package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +77 -0
  261. package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +69 -0
  262. package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +64 -0
  263. package/dist/vendor/use-sync-external-store/shim/index.js +11 -0
  264. package/dist/vendor/use-sync-external-store/shim/with-selector.js +11 -0
  265. package/package.json +13 -6
  266. package/dist/index.d.ts.map +0 -1
  267. package/dist/index.js.map +0 -1
@@ -0,0 +1,74 @@
1
+ import { __commonJSMin } from "../../../../_virtual/_rolldown/runtime.js";
2
+ import { require_builtin_esm_external_require_react } from "../../../../_virtual/builtin_esm-external-require-react.js";
3
+ import { require_shim } from "../../shim/index.js";
4
+ //#region ../../../node_modules/.pnpm/use-sync-external-store@1.7.0_react@19.3.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
5
+ /**
6
+ * @license React
7
+ * use-sync-external-store-shim/with-selector.development.js
8
+ *
9
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
10
+ *
11
+ * This source code is licensed under the MIT license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ */
14
+ var require_with_selector_development = /* @__PURE__ */ __commonJSMin(((exports) => {
15
+ "production" !== process.env.NODE_ENV && (function() {
16
+ function is(x, y) {
17
+ return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
18
+ }
19
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
20
+ var React = require_builtin_esm_external_require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim.useSyncExternalStore, useRef = React.useRef, useEffect = React.useEffect, useMemo = React.useMemo, useDebugValue = React.useDebugValue;
21
+ exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
22
+ var instRef = useRef(null);
23
+ if (null === instRef.current) {
24
+ var inst = {
25
+ hasValue: !1,
26
+ value: null
27
+ };
28
+ instRef.current = inst;
29
+ } else inst = instRef.current;
30
+ instRef = useMemo(function() {
31
+ function memoizedSelector(nextSnapshot) {
32
+ if (!hasMemo) {
33
+ hasMemo = !0;
34
+ memoizedSnapshot = nextSnapshot;
35
+ nextSnapshot = selector(nextSnapshot);
36
+ if (void 0 !== isEqual && inst.hasValue) {
37
+ var currentSelection = inst.value;
38
+ if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection;
39
+ }
40
+ return memoizedSelection = nextSnapshot;
41
+ }
42
+ currentSelection = memoizedSelection;
43
+ if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
44
+ var nextSelection = selector(nextSnapshot);
45
+ if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection;
46
+ memoizedSnapshot = nextSnapshot;
47
+ return memoizedSelection = nextSelection;
48
+ }
49
+ var hasMemo = !1, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
50
+ return [function() {
51
+ return memoizedSelector(getSnapshot());
52
+ }, null === maybeGetServerSnapshot ? void 0 : function() {
53
+ return memoizedSelector(maybeGetServerSnapshot());
54
+ }];
55
+ }, [
56
+ getSnapshot,
57
+ getServerSnapshot,
58
+ selector,
59
+ isEqual
60
+ ]);
61
+ var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
62
+ useEffect(function() {
63
+ inst.hasValue = !0;
64
+ inst.value = value;
65
+ }, [value]);
66
+ useDebugValue(value);
67
+ return value;
68
+ };
69
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
70
+ })();
71
+ }));
72
+ //#endregion
73
+ export default require_with_selector_development();
74
+ export { require_with_selector_development };
@@ -0,0 +1,77 @@
1
+ import { __commonJSMin } from "../../../../_virtual/_rolldown/runtime.js";
2
+ import { require_builtin_esm_external_require_react } from "../../../../_virtual/builtin_esm-external-require-react.js";
3
+ import { require_shim } from "../../shim/index.js";
4
+ //#region ../../../node_modules/.pnpm/use-sync-external-store@1.7.0_react@19.3.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js
5
+ /**
6
+ * @license React
7
+ * use-sync-external-store-shim/with-selector.production.js
8
+ *
9
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
10
+ *
11
+ * This source code is licensed under the MIT license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ */
14
+ var require_with_selector_production = /* @__PURE__ */ __commonJSMin(((exports) => {
15
+ var React = require_builtin_esm_external_require_react();
16
+ var shim = require_shim();
17
+ function is(x, y) {
18
+ return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
19
+ }
20
+ var objectIs = "function" === typeof Object.is ? Object.is : is;
21
+ var useSyncExternalStore = shim.useSyncExternalStore;
22
+ var useRef = React.useRef;
23
+ var useEffect = React.useEffect;
24
+ var useMemo = React.useMemo;
25
+ var useDebugValue = React.useDebugValue;
26
+ exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
27
+ var instRef = useRef(null);
28
+ if (null === instRef.current) {
29
+ var inst = {
30
+ hasValue: !1,
31
+ value: null
32
+ };
33
+ instRef.current = inst;
34
+ } else inst = instRef.current;
35
+ instRef = useMemo(function() {
36
+ function memoizedSelector(nextSnapshot) {
37
+ if (!hasMemo) {
38
+ hasMemo = !0;
39
+ memoizedSnapshot = nextSnapshot;
40
+ nextSnapshot = selector(nextSnapshot);
41
+ if (void 0 !== isEqual && inst.hasValue) {
42
+ var currentSelection = inst.value;
43
+ if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection;
44
+ }
45
+ return memoizedSelection = nextSnapshot;
46
+ }
47
+ currentSelection = memoizedSelection;
48
+ if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
49
+ var nextSelection = selector(nextSnapshot);
50
+ if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection;
51
+ memoizedSnapshot = nextSnapshot;
52
+ return memoizedSelection = nextSelection;
53
+ }
54
+ var hasMemo = !1, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
55
+ return [function() {
56
+ return memoizedSelector(getSnapshot());
57
+ }, null === maybeGetServerSnapshot ? void 0 : function() {
58
+ return memoizedSelector(maybeGetServerSnapshot());
59
+ }];
60
+ }, [
61
+ getSnapshot,
62
+ getServerSnapshot,
63
+ selector,
64
+ isEqual
65
+ ]);
66
+ var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
67
+ useEffect(function() {
68
+ inst.hasValue = !0;
69
+ inst.value = value;
70
+ }, [value]);
71
+ useDebugValue(value);
72
+ return value;
73
+ };
74
+ }));
75
+ //#endregion
76
+ export default require_with_selector_production();
77
+ export { require_with_selector_production };
@@ -0,0 +1,69 @@
1
+ import { __commonJSMin } from "../../../_virtual/_rolldown/runtime.js";
2
+ import { require_builtin_esm_external_require_react } from "../../../_virtual/builtin_esm-external-require-react.js";
3
+ //#region ../../../node_modules/.pnpm/use-sync-external-store@1.7.0_react@19.3.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
4
+ /**
5
+ * @license React
6
+ * use-sync-external-store-shim.development.js
7
+ *
8
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ var require_use_sync_external_store_shim_development = /* @__PURE__ */ __commonJSMin(((exports) => {
14
+ "production" !== process.env.NODE_ENV && (function() {
15
+ function is(x, y) {
16
+ return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
17
+ }
18
+ function useSyncExternalStore$2(subscribe, getSnapshot) {
19
+ didWarnOld18Alpha || void 0 === React.startTransition || (didWarnOld18Alpha = !0, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
20
+ var value = getSnapshot();
21
+ if (!didWarnUncachedGetSnapshot) {
22
+ var cachedValue = getSnapshot();
23
+ objectIs(value, cachedValue) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = !0);
24
+ }
25
+ cachedValue = useState({ inst: {
26
+ value,
27
+ getSnapshot
28
+ } });
29
+ var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
30
+ useLayoutEffect(function() {
31
+ inst.value = value;
32
+ inst.getSnapshot = getSnapshot;
33
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
34
+ }, [
35
+ subscribe,
36
+ value,
37
+ getSnapshot
38
+ ]);
39
+ useEffect(function() {
40
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
41
+ return subscribe(function() {
42
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
43
+ });
44
+ }, [subscribe]);
45
+ useDebugValue(value);
46
+ return value;
47
+ }
48
+ function checkIfSnapshotChanged(inst) {
49
+ var latestGetSnapshot = inst.getSnapshot;
50
+ inst = inst.value;
51
+ try {
52
+ var nextValue = latestGetSnapshot();
53
+ return !objectIs(inst, nextValue);
54
+ } catch (error) {
55
+ return !0;
56
+ }
57
+ }
58
+ function useSyncExternalStore$1(subscribe, getSnapshot) {
59
+ return getSnapshot();
60
+ }
61
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
62
+ var React = require_builtin_esm_external_require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState = React.useState, useEffect = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue, didWarnOld18Alpha = !1, didWarnUncachedGetSnapshot = !1, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
63
+ exports.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
64
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
65
+ })();
66
+ }));
67
+ //#endregion
68
+ export default require_use_sync_external_store_shim_development();
69
+ export { require_use_sync_external_store_shim_development };
@@ -0,0 +1,64 @@
1
+ import { __commonJSMin } from "../../../_virtual/_rolldown/runtime.js";
2
+ import { require_builtin_esm_external_require_react } from "../../../_virtual/builtin_esm-external-require-react.js";
3
+ //#region ../../../node_modules/.pnpm/use-sync-external-store@1.7.0_react@19.3.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
4
+ /**
5
+ * @license React
6
+ * use-sync-external-store-shim.production.js
7
+ *
8
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ var require_use_sync_external_store_shim_production = /* @__PURE__ */ __commonJSMin(((exports) => {
14
+ var React = require_builtin_esm_external_require_react();
15
+ function is(x, y) {
16
+ return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
17
+ }
18
+ var objectIs = "function" === typeof Object.is ? Object.is : is;
19
+ var useState = React.useState;
20
+ var useEffect = React.useEffect;
21
+ var useLayoutEffect = React.useLayoutEffect;
22
+ var useDebugValue = React.useDebugValue;
23
+ function useSyncExternalStore$2(subscribe, getSnapshot) {
24
+ var value = getSnapshot(), _useState = useState({ inst: {
25
+ value,
26
+ getSnapshot
27
+ } }), inst = _useState[0].inst, forceUpdate = _useState[1];
28
+ useLayoutEffect(function() {
29
+ inst.value = value;
30
+ inst.getSnapshot = getSnapshot;
31
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
32
+ }, [
33
+ subscribe,
34
+ value,
35
+ getSnapshot
36
+ ]);
37
+ useEffect(function() {
38
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
39
+ return subscribe(function() {
40
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
41
+ });
42
+ }, [subscribe]);
43
+ useDebugValue(value);
44
+ return value;
45
+ }
46
+ function checkIfSnapshotChanged(inst) {
47
+ var latestGetSnapshot = inst.getSnapshot;
48
+ inst = inst.value;
49
+ try {
50
+ var nextValue = latestGetSnapshot();
51
+ return !objectIs(inst, nextValue);
52
+ } catch (error) {
53
+ return !0;
54
+ }
55
+ }
56
+ function useSyncExternalStore$1(subscribe, getSnapshot) {
57
+ return getSnapshot();
58
+ }
59
+ var shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
60
+ exports.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
61
+ }));
62
+ //#endregion
63
+ export default require_use_sync_external_store_shim_production();
64
+ export { require_use_sync_external_store_shim_production };
@@ -0,0 +1,11 @@
1
+ import { __commonJSMin } from "../../../_virtual/_rolldown/runtime.js";
2
+ import { require_use_sync_external_store_shim_production } from "../cjs/use-sync-external-store-shim.production.js";
3
+ import { require_use_sync_external_store_shim_development } from "../cjs/use-sync-external-store-shim.development.js";
4
+ //#region ../../../node_modules/.pnpm/use-sync-external-store@1.7.0_react@19.3.0/node_modules/use-sync-external-store/shim/index.js
5
+ var require_shim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6
+ if (process.env.NODE_ENV === "production") module.exports = require_use_sync_external_store_shim_production();
7
+ else module.exports = require_use_sync_external_store_shim_development();
8
+ }));
9
+ //#endregion
10
+ export default require_shim();
11
+ export { require_shim };
@@ -0,0 +1,11 @@
1
+ import { __commonJSMin } from "../../../_virtual/_rolldown/runtime.js";
2
+ import { require_with_selector_production } from "../cjs/use-sync-external-store-shim/with-selector.production.js";
3
+ import { require_with_selector_development } from "../cjs/use-sync-external-store-shim/with-selector.development.js";
4
+ //#region ../../../node_modules/.pnpm/use-sync-external-store@1.7.0_react@19.3.0/node_modules/use-sync-external-store/shim/with-selector.js
5
+ var require_with_selector = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6
+ if (process.env.NODE_ENV === "production") module.exports = require_with_selector_production();
7
+ else module.exports = require_with_selector_development();
8
+ }));
9
+ //#endregion
10
+ export default require_with_selector();
11
+ export { require_with_selector };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monimesl/dot-renderer-react",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "0.1.0-alpha.23",
4
4
  "description": "React renderer for Dot webviews",
5
5
  "type": "module",
6
6
  "repository": {
@@ -8,7 +8,9 @@
8
8
  "url": "git+https://github.com/monime-lab/dot.git",
9
9
  "directory": "packages/renderers/react"
10
10
  },
11
- "sideEffects": false,
11
+ "sideEffects": [
12
+ "**/*.css"
13
+ ],
12
14
  "files": [
13
15
  "dist"
14
16
  ],
@@ -26,27 +28,32 @@
26
28
  "dependencies": {
27
29
  "react": "^19.3.0",
28
30
  "react-dom": "^19.3.0",
29
- "@monimesl/dot-core": "0.1.0-alpha.2",
30
- "@monimesl/dot-webview": "0.1.0-alpha.2"
31
+ "uqr": "^0.1.3",
32
+ "@monimesl/dot-core": "0.1.0-alpha.23",
33
+ "@monimesl/dot-webview": "0.1.0-alpha.23"
31
34
  },
32
35
  "devDependencies": {
36
+ "@base-ui/react": "1.8.0",
37
+ "@phosphor-icons/core": "^2.1.1",
33
38
  "@testing-library/react": "^16.3.3",
34
39
  "@types/react": "^19.3.0",
35
40
  "@types/react-dom": "^19.3.0",
36
41
  "jsdom": "^30.1.1",
42
+ "lightningcss": "1.33.0",
37
43
  "publint": "^0.3.24",
38
44
  "rimraf": "^6.1.3",
39
45
  "rolldown": "^1.2.9",
40
46
  "tsdown": "^0.23.0",
41
47
  "typescript": "^5.9.3",
42
48
  "vitest": "^5.0.1",
43
- "@monimesl/dot-service": "0.1.0-alpha.2"
49
+ "@monimesl/dot-service": "0.1.0-alpha.23"
44
50
  },
45
51
  "publishConfig": {
46
52
  "access": "public"
47
53
  },
48
54
  "scripts": {
49
- "build": "tsdown && node scripts/build-react-host.mjs",
55
+ "build": "pnpm icons:generate && tsdown && node scripts/build-styles.mjs && cp node_modules/@phosphor-icons/core/LICENSE dist/LICENSE-PHOSPHOR && node scripts/build-react-host.mjs",
56
+ "icons:generate": "node scripts/generate-icon-artwork.mjs && prettier --write src/components/icon-artwork.ts",
50
57
  "dev": "tsdown --watch",
51
58
  "typecheck": "tsc --noEmit -p tsconfig.json",
52
59
  "test": "vitest run",
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/root.tsx","../src/types.ts","../src/components/index.ts","../src/renderer.tsx","../src/theme.ts"],"mappings":";;;;KAUY,UAAU;EAAgB,OAAO;EAAO,UAAU;;;;KCPlD,eAAe,UAAU,qBAAqB,cAAc,QAAQ,GAAG;KAEvE,gBAAgB,kBAAkB,eAAe,kCACjD,WAAW,YAAY,eAAe,UAAU;KAGhD,yBAAyB,gBAAgB;;;qBCFxC,UAAU;;;UCGN;EACf,aAAa,QAAQ,0BACnB,SAAS,eAAe;EAC1B,UAAU;;iBAGI,gBAAgB,YAAiB,YAAW,uBAA4B;;;UCbvE;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,QAAQ;EACR,QAAQ;EACR;;wBA6Bc,aAAa,OAAO,OAAO,cAAc,cAAc;wBAsBvD,YAAY"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/theme.ts","../src/components/tokens.ts","../src/components/button.tsx","../src/components/image.tsx","../src/components/input.tsx","../src/components/text.tsx","../src/components/view.tsx","../src/components/index.ts","../src/page-root.tsx","../src/root.tsx","../src/renderer.tsx","../src/index.ts"],"sourcesContent":["import type { ColorScheme, SchemeColor, Theme } from '@monimesl/dot-core';\nimport { createContext, useContext } from 'react';\n\nexport interface ResolvedColors {\n primary: string;\n background: string;\n surface: string;\n text: string;\n subtle: string;\n muted: string;\n border: string;\n}\n\nexport interface ResolvedTheme {\n scheme: ColorScheme;\n colors: ResolvedColors;\n radius: number;\n}\n\nexport const FONT_FAMILY = 'system-ui, sans-serif';\n\nconst DEFAULT_RADIUS = 12;\n\n// Dash's own look: black, white and grays, so a dot feels at home in it.\nconst DEFAULT_COLORS: Record<ColorScheme, ResolvedColors> = {\n light: {\n primary: '#1c1c1e',\n background: '#f2f2f2',\n surface: '#ffffff',\n text: '#111111',\n subtle: '#8e8e93',\n muted: '#e9e9eb',\n border: '#e9e9eb',\n },\n dark: {\n primary: '#f5f5f5',\n background: '#121212',\n surface: '#1e1e1e',\n text: '#f5f5f5',\n subtle: '#8e8e93',\n muted: '#2c2c2e',\n border: '#2a2a2c',\n },\n};\n\nexport function resolveTheme(theme: Theme, systemScheme: ColorScheme): ResolvedTheme {\n const scheme = !theme.scheme || theme.scheme === 'system' ? systemScheme : theme.scheme;\n const defaults = DEFAULT_COLORS[scheme];\n const colors = theme.colors ?? {};\n const pick = (color: SchemeColor | undefined, fallback: string) => color?.[scheme] ?? fallback;\n return {\n scheme,\n colors: {\n primary: pick(colors.primary, defaults.primary),\n background: pick(colors.background, defaults.background),\n surface: pick(colors.surface, defaults.surface),\n text: pick(colors.text, defaults.text),\n subtle: defaults.subtle,\n muted: defaults.muted,\n border: defaults.border,\n },\n radius: theme.radius ?? DEFAULT_RADIUS,\n };\n}\n\nexport const ThemeContext = createContext<ResolvedTheme>(resolveTheme({}, 'light'));\n\nexport function useTheme(): ResolvedTheme {\n return useContext(ThemeContext);\n}\n","export const GAP = { none: 0, small: 4, medium: 8, large: 16 } as const;\n\nexport const FONT_SIZE = { caption: 13, body: 15, title: 20 } as const;\n\n// Between content and the edge of the page or of a card.\nexport const PADDING = 16;\n\n// Cards round a little more than the controls inside them.\nexport const CARD_RADIUS_SCALE = 1.5;\n\nexport const DISABLED_OPACITY = 0.6;\n","import type { Button as ButtonManifest } from '@monimesl/dot-core';\nimport { createEvent } from '@monimesl/dot-core';\n\nimport type { ReactComponent } from '../types';\nimport { useTheme } from '../theme';\nimport { DISABLED_OPACITY, FONT_SIZE } from './tokens';\n\nexport const Button: ReactComponent<typeof ButtonManifest> = ({\n variant = 'primary',\n disabled,\n onClick,\n children,\n}) => {\n const { colors, radius } = useTheme();\n const filled = variant === 'primary' && !disabled;\n let color = colors.text;\n if (filled) {\n color = colors.surface;\n } else if (disabled) {\n color = colors.subtle;\n }\n const handleClick = onClick ? () => onClick(createEvent('click')) : undefined;\n return (\n <button\n type=\"button\"\n className=\"dot-button\"\n data-variant={variant}\n disabled={disabled}\n onClick={handleClick}\n style={{\n padding: '10px 16px',\n border: 'none',\n borderRadius: radius,\n background: filled ? colors.primary : colors.muted,\n color,\n font: 'inherit',\n fontSize: FONT_SIZE.body,\n fontWeight: 600,\n opacity: disabled ? DISABLED_OPACITY : 1,\n cursor: disabled ? 'default' : 'pointer',\n }}\n >\n {children}\n </button>\n );\n};\n","import type { Image as ImageManifest } from '@monimesl/dot-core';\nimport { createEvent } from '@monimesl/dot-core';\nimport type { SyntheticEvent } from 'react';\n\nimport type { ReactComponent } from '../types';\nimport { useTheme } from '../theme';\n\nexport const Image: ReactComponent<typeof ImageManifest> = ({\n src,\n alt,\n width,\n height,\n onLoad,\n onError,\n}) => {\n const { radius } = useTheme();\n const handleLoad = onLoad\n ? (event: SyntheticEvent<HTMLImageElement>) => {\n const { naturalWidth, naturalHeight } = event.currentTarget;\n onLoad(createEvent('load', { width: naturalWidth, height: naturalHeight }));\n }\n : undefined;\n const handleError = onError\n ? () => onError(createEvent('error', { message: `Failed to load ${src}` }))\n : undefined;\n return (\n <img\n className=\"dot-image\"\n src={src}\n alt={alt ?? ''}\n width={width}\n height={height}\n style={{ borderRadius: radius }}\n onLoad={handleLoad}\n onError={handleError}\n />\n );\n};\n","import type { Input as InputManifest } from '@monimesl/dot-core';\nimport { createEvent } from '@monimesl/dot-core';\nimport { useState } from 'react';\n\nimport type { ReactComponent } from '../types';\nimport { useTheme } from '../theme';\nimport { DISABLED_OPACITY } from './tokens';\n\nconst HTML_TYPES = {\n text: { type: 'text', inputMode: 'text' },\n number: { type: 'text', inputMode: 'decimal' },\n email: { type: 'email', inputMode: 'email' },\n phone: { type: 'tel', inputMode: 'tel' },\n password: { type: 'password', inputMode: 'text' },\n} as const;\n\nexport const Input: ReactComponent<typeof InputManifest> = ({\n value,\n placeholder,\n label,\n type = 'text',\n maxLength,\n disabled,\n onChange,\n onSubmit,\n}) => {\n const { colors, radius } = useTheme();\n const [text, setText] = useState(value ?? '');\n const [awaitingEcho, setAwaitingEcho] = useState<string[]>([]);\n const [previousValue, setPreviousValue] = useState(value);\n\n // `value` is page state, which the service updates a moment after each keystroke. By the time\n // it sends back \"a\", the user may have typed \"abc\"; showing \"a\" would erase \"bc\". So a value\n // the user already typed is a late echo and is ignored. A value the user never typed, such as\n // a reset, was set by the page and replaces the text.\n if (value !== previousValue) {\n setPreviousValue(value);\n const echo = awaitingEcho.indexOf(value ?? '');\n if (echo >= 0) {\n setAwaitingEcho(awaitingEcho.slice(echo + 1));\n } else {\n setAwaitingEcho([]);\n setText(value ?? '');\n }\n }\n return (\n <input\n className=\"dot-input\"\n {...HTML_TYPES[type]}\n value={text}\n placeholder={placeholder}\n aria-label={label}\n maxLength={maxLength}\n disabled={disabled}\n onChange={(event) => {\n const next = event.currentTarget.value;\n setText(next);\n if (onChange && value !== undefined) {\n setAwaitingEcho([...awaitingEcho, next]);\n }\n onChange?.(createEvent('change', { value: next }));\n }}\n onKeyDown={(event) => {\n if (event.key === 'Enter' && onSubmit) {\n onSubmit(createEvent('submit', { value: text }));\n }\n }}\n style={{\n width: '100%',\n boxSizing: 'border-box',\n padding: '12px 14px',\n border: `1px solid ${colors.border}`,\n borderRadius: radius,\n background: colors.surface,\n color: colors.text,\n outlineColor: colors.primary,\n font: 'inherit',\n // At least 16px, or iOS zooms into the page when the field is focused.\n fontSize: 16,\n opacity: disabled ? DISABLED_OPACITY : 1,\n }}\n />\n );\n};\n","import type { Text as TextManifest } from '@monimesl/dot-core';\n\nimport type { ReactComponent } from '../types';\nimport { FONT_SIZE } from './tokens';\n\nconst VARIANTS = {\n body: { fontSize: FONT_SIZE.body },\n caption: { fontSize: FONT_SIZE.caption },\n title: { fontSize: FONT_SIZE.title, fontWeight: 600 },\n} as const;\n\nexport const Text: ReactComponent<typeof TextManifest> = ({ variant = 'body', children }) => (\n <span className=\"dot-text\" style={VARIANTS[variant]}>\n {children}\n </span>\n);\n","import type { View as ViewManifest } from '@monimesl/dot-core';\nimport { createEvent } from '@monimesl/dot-core';\n\nimport type { ReactComponent } from '../types';\nimport { useTheme } from '../theme';\nimport { CARD_RADIUS_SCALE, GAP, PADDING } from './tokens';\n\nconst ALIGN = {\n stretch: 'stretch',\n start: 'flex-start',\n center: 'center',\n end: 'flex-end',\n} as const;\n\nexport const View: ReactComponent<typeof ViewManifest> = ({\n direction = 'column',\n gap = 'medium',\n align = 'stretch',\n variant = 'plain',\n onTap,\n children,\n}) => {\n const { colors, radius } = useTheme();\n const card = variant === 'card';\n const handleClick = onTap ? () => onTap(createEvent('tap')) : undefined;\n return (\n <div\n className=\"dot-view\"\n onClick={handleClick}\n style={{\n display: 'flex',\n flexDirection: direction,\n gap: GAP[gap],\n alignItems: ALIGN[align],\n padding: card ? PADDING : undefined,\n borderRadius: card ? radius * CARD_RADIUS_SCALE : undefined,\n background: card ? colors.surface : undefined,\n border: card ? `1px solid ${colors.border}` : undefined,\n cursor: onTap ? 'pointer' : undefined,\n }}\n >\n {children}\n </div>\n );\n};\n","import type { BuiltinReactComponents } from '../types';\nimport { Button } from './button';\nimport { Image } from './image';\nimport { Input } from './input';\nimport { Text } from './text';\nimport { View } from './view';\n\nexport const builtins: BuiltinReactComponents = { Button, Image, Input, Text, View };\n","import type { ComponentType, ReactNode } from 'react';\nimport { createElement, Fragment, useMemo, useSyncExternalStore } from 'react';\nimport type { RenderContext } from '@monimesl/dot-core';\nimport { toList, toText } from '@monimesl/dot-core';\nimport type { PageController } from '@monimesl/dot-webview';\n\nexport type ComponentMap = Readonly<Record<string, ComponentType<Record<string, unknown>>>>;\n\ninterface PageRootProps {\n page: PageController;\n components: ComponentMap;\n}\n\nexport function PageRoot({ page, components }: PageRootProps) {\n const state = useSyncExternalStore(page.subscribe, page.getState);\n const context = useMemo<RenderContext<ReactNode>>(\n () => ({\n h(type, props, ...children) {\n const component = components[type];\n if (!component) {\n throw new Error(`The renderer has no component registered for tag '<${type}>'`);\n }\n return createElement(component, props, ...children);\n },\n text: toText,\n on: (handler) => page.on(handler),\n each: (items, render, key) =>\n createElement(\n Fragment,\n null,\n toList(items).map((item, index) =>\n createElement(\n Fragment,\n { key: key ? String(key(item, index)) : index },\n ...render(item, index),\n ),\n ),\n ),\n }),\n [page, components],\n );\n if (!state) {\n return null;\n }\n return createElement(Fragment, null, ...page.viewRenderer(state, context));\n}\n","import type { Theme } from '@monimesl/dot-core';\nimport type { ComponentType, ReactNode } from 'react';\nimport { useMemo, useSyncExternalStore } from 'react';\nimport type { DotContext, PageController } from '@monimesl/dot-webview';\n\nimport type { ComponentMap } from './page-root';\nimport { PageRoot } from './page-root';\nimport { PADDING } from './components/tokens';\nimport { FONT_FAMILY, resolveTheme, ThemeContext, useTheme } from './theme';\n\nexport type Wrapper = ComponentType<{ theme: Theme; children: ReactNode }>;\n\ninterface RootProps {\n page: PageController;\n dotContext: DotContext;\n components: ComponentMap;\n wrapper: Wrapper | undefined;\n}\n\nexport function Root({ page, dotContext, components, wrapper: Wrapper }: RootProps) {\n const theme = useSyncExternalStore(dotContext.theme.subscribe, dotContext.theme.get);\n const systemContext = useSyncExternalStore(\n dotContext.systemContext.subscribe,\n dotContext.systemContext.get,\n );\n const resolved = useMemo(\n () => resolveTheme(theme, systemContext.scheme),\n [theme, systemContext.scheme],\n );\n const content = <PageRoot page={page} components={components} />;\n\n return (\n <ThemeContext.Provider value={resolved}>\n {Wrapper ? (\n <Wrapper theme={{ ...theme, scheme: resolved.scheme }}>{content}</Wrapper>\n ) : (\n <DefaultSurface>{content}</DefaultSurface>\n )}\n </ThemeContext.Provider>\n );\n}\n\nfunction DefaultSurface({ children }: { children: ReactNode }) {\n const { colors } = useTheme();\n return (\n <div\n className=\"dot-surface\"\n style={{\n minHeight: '100vh',\n boxSizing: 'border-box',\n padding: PADDING,\n display: 'flex',\n flexDirection: 'column',\n gap: 12,\n background: colors.background,\n color: colors.text,\n fontFamily: FONT_FAMILY,\n }}\n >\n {children}\n </div>\n );\n}\n","import type { Renderer } from '@monimesl/dot-webview';\nimport type { JSXElementConstructor } from 'react';\nimport { createRoot } from 'react-dom/client';\n\nimport { builtins } from './components';\nimport type { ComponentMap } from './page-root';\nimport type { Wrapper } from './root';\nimport { Root } from './root';\nimport type { BuiltinReactComponents } from './types';\n\nexport interface ReactRendererOptions {\n components?: Partial<BuiltinReactComponents> &\n Readonly<Record<string, JSXElementConstructor<never>>>;\n wrapper?: Wrapper;\n}\n\nexport function reactRenderer({ components = {}, wrapper }: ReactRendererOptions = {}): Renderer {\n const registry = { ...builtins, ...components } as unknown as ComponentMap;\n\n return {\n name: 'react',\n mount(container, page, dotContext) {\n const root = createRoot(container);\n root.render(\n <Root page={page} dotContext={dotContext} components={registry} wrapper={wrapper} />,\n );\n return () => root.unmount();\n },\n };\n}\n","export type { Wrapper } from './root';\nexport { builtins } from './components';\nimport { reactRenderer } from './renderer';\n\nexport type { ReactRendererOptions } from './renderer';\n\nexport { resolveTheme, useTheme } from './theme';\nexport type { ResolvedColors, ResolvedTheme } from './theme';\n\nexport type { BuiltinReactComponents, ReactComponent, ReactComponents } from './types';\n\nexport default reactRenderer;\n"],"mappings":";;;;;AAmBA,MAAa,cAAc;AAE3B,MAAM,iBAAiB;AAGvB,MAAM,iBAAsD;CAC1D,OAAO;EACL,SAAS;EACT,YAAY;EACZ,SAAS;EACT,MAAM;EACN,QAAQ;EACR,OAAO;EACP,QAAQ;CACV;CACA,MAAM;EACJ,SAAS;EACT,YAAY;EACZ,SAAS;EACT,MAAM;EACN,QAAQ;EACR,OAAO;EACP,QAAQ;CACV;AACF;AAEA,SAAgB,aAAa,OAAc,cAA0C;CACnF,MAAM,SAAS,CAAC,MAAM,UAAU,MAAM,WAAW,WAAW,eAAe,MAAM;CACjF,MAAM,WAAW,eAAe;CAChC,MAAM,SAAS,MAAM,UAAU,CAAC;CAChC,MAAM,QAAQ,OAAgC,aAAqB,QAAQ,WAAW;CACtF,OAAO;EACL;EACA,QAAQ;GACN,SAAS,KAAK,OAAO,SAAS,SAAS,OAAO;GAC9C,YAAY,KAAK,OAAO,YAAY,SAAS,UAAU;GACvD,SAAS,KAAK,OAAO,SAAS,SAAS,OAAO;GAC9C,MAAM,KAAK,OAAO,MAAM,SAAS,IAAI;GACrC,QAAQ,SAAS;GACjB,OAAO,SAAS;GAChB,QAAQ,SAAS;EACnB;EACA,QAAQ,MAAM,UAAU;CAC1B;AACF;AAEA,MAAa,eAAe,cAA6B,aAAa,CAAC,GAAG,OAAO,CAAC;AAElF,SAAgB,WAA0B;CACxC,OAAO,WAAW,YAAY;AAChC;;;ACrEA,MAAa,MAAM;CAAE,MAAM;CAAG,OAAO;CAAG,QAAQ;CAAG,OAAO;AAAG;AAE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