@octane-xplat/ui 0.2.1 → 0.3.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/native/octane-client-build.json +1 -1
  2. package/dist/native/ui.js +40 -19
  3. package/dist/native/ui10.js +19 -48
  4. package/dist/native/ui11.js +118 -56
  5. package/dist/native/ui12.js +114 -16
  6. package/dist/native/ui13.js +54 -18
  7. package/dist/native/ui14.js +76 -13
  8. package/dist/native/ui15.js +128 -18
  9. package/dist/native/ui16.js +48 -136
  10. package/dist/native/ui17.js +42 -19
  11. package/dist/native/ui18.js +50 -9
  12. package/dist/native/ui19.js +34 -12
  13. package/dist/native/ui2.js +10 -48
  14. package/dist/native/ui20.js +17 -0
  15. package/dist/native/ui21.js +93 -0
  16. package/dist/native/ui22.js +124 -0
  17. package/dist/native/ui23.js +103 -0
  18. package/dist/native/ui24.js +58 -0
  19. package/dist/native/ui25.js +19 -0
  20. package/dist/native/ui26.js +27 -0
  21. package/dist/native/ui27.js +35 -0
  22. package/dist/native/ui28.js +146 -0
  23. package/dist/native/ui29.js +28 -0
  24. package/dist/native/ui3.js +17 -20
  25. package/dist/native/ui30.js +35 -0
  26. package/dist/native/ui31.js +39 -0
  27. package/dist/native/ui32.js +70 -0
  28. package/dist/native/ui33.js +30 -0
  29. package/dist/native/ui34.js +10 -0
  30. package/dist/native/ui35.js +27 -0
  31. package/dist/native/ui36.js +34 -0
  32. package/dist/native/ui37.js +17 -0
  33. package/dist/native/ui38.js +68 -0
  34. package/dist/native/ui39.js +33 -0
  35. package/dist/native/ui4.js +21 -48
  36. package/dist/native/ui40.js +14 -0
  37. package/dist/native/ui41.js +104 -0
  38. package/dist/native/ui42.js +148 -0
  39. package/dist/native/ui43.js +22 -0
  40. package/dist/native/ui44.js +8 -0
  41. package/dist/native/ui5.js +70 -27
  42. package/dist/native/ui6.js +36 -20
  43. package/dist/native/ui7.js +24 -61
  44. package/dist/native/ui8.js +16 -18
  45. package/dist/native/ui9.js +16 -13
  46. package/dist/web/octane-client-build.json +1 -1
  47. package/dist/web/ui.js +40 -19
  48. package/dist/web/ui10.js +187 -31
  49. package/dist/web/ui11.js +419 -53
  50. package/dist/web/ui12.js +83 -15
  51. package/dist/web/ui13.js +107 -19
  52. package/dist/web/ui14.js +98 -18
  53. package/dist/web/ui15.js +83 -47
  54. package/dist/web/ui16.js +100 -93
  55. package/dist/web/ui17.js +36 -22
  56. package/dist/web/ui18.js +29 -15
  57. package/dist/web/ui19.js +9 -7
  58. package/dist/web/ui2.js +15 -103
  59. package/dist/web/ui20.js +114 -0
  60. package/dist/web/ui21.js +82 -0
  61. package/dist/web/ui22.js +68 -0
  62. package/dist/web/ui23.js +57 -0
  63. package/dist/web/ui24.js +16 -0
  64. package/dist/web/ui25.js +22 -0
  65. package/dist/web/ui26.js +39 -0
  66. package/dist/web/ui27.js +127 -0
  67. package/dist/web/ui28.js +112 -0
  68. package/dist/web/ui29.js +108 -0
  69. package/dist/web/ui3.js +19 -27
  70. package/dist/web/ui30.js +43 -0
  71. package/dist/web/ui31.js +42 -0
  72. package/dist/web/ui32.js +77 -0
  73. package/dist/web/ui33.js +43 -0
  74. package/dist/web/ui34.js +67 -0
  75. package/dist/web/ui35.js +9 -0
  76. package/dist/web/ui36.js +45 -0
  77. package/dist/web/ui37.js +47 -0
  78. package/dist/web/ui38.js +17 -0
  79. package/dist/web/ui39.js +100 -0
  80. package/dist/web/ui4.js +145 -17
  81. package/dist/web/ui40.js +41 -0
  82. package/dist/web/ui41.js +17 -0
  83. package/dist/web/ui42.js +9 -0
  84. package/dist/web/ui43.js +22 -0
  85. package/dist/web/ui44.js +8 -0
  86. package/dist/web/ui5.js +54 -52
  87. package/dist/web/ui6.js +43 -16
  88. package/dist/web/ui7.js +29 -46
  89. package/dist/web/ui8.js +29 -18
  90. package/dist/web/ui9.js +24 -16
  91. package/package.json +6 -3
  92. package/src/theme/tokens.css +166 -0
  93. package/types/index.d.ts +108 -1
  94. package/types/props.d.ts +333 -8
@@ -0,0 +1,42 @@
1
+ import { hookSlots, useEffect, useState } from "octane";
2
+ //#region src/safeAreaInsets.web.tsrx
3
+ var _hs$ = /* @__PURE__ */ hookSlots(2);
4
+ var _h$0 = /* @__PURE__ */ Symbol(_hs$);
5
+ var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
6
+ function measure() {
7
+ if (!document.body) return {
8
+ top: 0,
9
+ right: 0,
10
+ bottom: 0,
11
+ left: 0
12
+ };
13
+ const probe = document.createElement("div");
14
+ probe.style.cssText = "position:fixed;visibility:hidden;pointer-events:none;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);padding:constant(safe-area-inset-top) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);";
15
+ document.body.appendChild(probe);
16
+ const style = getComputedStyle(probe);
17
+ const insets = {
18
+ top: parseFloat(style.paddingTop) || 0,
19
+ right: parseFloat(style.paddingRight) || 0,
20
+ bottom: parseFloat(style.paddingBottom) || 0,
21
+ left: parseFloat(style.paddingLeft) || 0
22
+ };
23
+ probe.remove();
24
+ return insets;
25
+ }
26
+ function useSafeAreaInsets() {
27
+ const [insets, setInsets] = useState({
28
+ top: 0,
29
+ right: 0,
30
+ bottom: 0,
31
+ left: 0
32
+ }, _h$0);
33
+ useEffect(() => {
34
+ const update = () => setInsets(measure());
35
+ update();
36
+ window.addEventListener("resize", update);
37
+ return () => window.removeEventListener("resize", update);
38
+ }, [], _h$1);
39
+ return insets;
40
+ }
41
+ //#endregion
42
+ export { useSafeAreaInsets };
@@ -0,0 +1,77 @@
1
+ import { useSafeAreaInsets } from "./ui31.js";
2
+ import { __s, bag11, clone, hookSlots, queueRefAttach, queueRefDetach, setStyle, setStyleProperty, template, withSlot } from "octane";
3
+ import { canSplitStyleProperties, childTextHoleUpdate, replaceRef, styleObjectPrototype, updateFreshClassName } from "octane/internal/client";
4
+ //#region src/SafeArea.web.tsrx
5
+ var _t$0 = /* @__PURE__ */ template("<div></div>");
6
+ var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots(1));
7
+ var _rm$1 = [
8
+ "r",
9
+ "b",
10
+ "a"
11
+ ];
12
+ function applyWebProps(node, bag) {
13
+ if (!node || !bag) return;
14
+ for (const [key, value] of Object.entries(bag)) if (key.includes("-")) node.setAttribute(key, String(value));
15
+ else node[key] = value;
16
+ }
17
+ var SafeArea = /* @__PURE__ */ __s(function SafeArea(props, __s, __extra) {
18
+ const insets = withSlot(_h$0, useSafeAreaInsets);
19
+ if (__s.block.pending && !__s.block.crossRenderUpdate) return;
20
+ let _b = __s.slots[0];
21
+ if (_b === void 0) {
22
+ let _m0, _m1;
23
+ const _root = clone(_t$0);
24
+ queueRefAttach(__s, _m1 = (node) => applyWebProps(node, props.web), _m0 = _root);
25
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.b, _b.a));
26
+ _b = bag11(__s, _root, _m0, _m1, void 0, __s, void 0, void 0, void 0, void 0, void 0, null, void 0);
27
+ __s.refFields = _rm$1;
28
+ } else {
29
+ const _r = (node) => applyWebProps(node, props.web);
30
+ if (_r !== _b.b) _b.b = replaceRef(__s, _b.b, _r, _b.a);
31
+ }
32
+ _b.c = updateFreshClassName(["vx-safe-area", props.className], _b.c, _b.a);
33
+ {
34
+ const __styleSpread = { ...props.style };
35
+ const __styleValue = insets.top;
36
+ const __styleValue$ = insets.right;
37
+ const __styleValue$2 = insets.bottom;
38
+ const __styleValue$3 = insets.left;
39
+ const __styleFull = "paddingTop" in __styleSpread || "paddingRight" in __styleSpread || "paddingBottom" in __styleSpread || "paddingLeft" in __styleSpread || !canSplitStyleProperties();
40
+ if (_b.d === __s || __styleFull || _b.e) {
41
+ const __styleObject = __styleFull && !("paddingTop" in styleObjectPrototype || "paddingRight" in styleObjectPrototype || "paddingBottom" in styleObjectPrototype || "paddingLeft" in styleObjectPrototype) ? (__styleSpread["paddingTop"] = __styleValue, __styleSpread["paddingRight"] = __styleValue$, __styleSpread["paddingBottom"] = __styleValue$2, __styleSpread["paddingLeft"] = __styleValue$3, __styleSpread) : {
42
+ ...__styleSpread,
43
+ "paddingTop": __styleValue,
44
+ "paddingRight": __styleValue$,
45
+ "paddingBottom": __styleValue$2,
46
+ "paddingLeft": __styleValue$3
47
+ };
48
+ setStyle(_b.a, __styleObject, _b.d === __s ? void 0 : _b.e ? _b.d : {
49
+ ..._b.d,
50
+ "paddingTop": _b.f,
51
+ "paddingRight": _b.g,
52
+ "paddingBottom": _b.h,
53
+ "paddingLeft": _b.i
54
+ });
55
+ _b.d = __styleFull ? __styleObject : __styleSpread;
56
+ } else {
57
+ setStyle(_b.a, __styleSpread, _b.d);
58
+ if (_b.f !== __styleValue) setStyleProperty(_b.a, "paddingTop", __styleValue, "", _b.f);
59
+ if (_b.g !== __styleValue$) setStyleProperty(_b.a, "paddingRight", __styleValue$, "", _b.g);
60
+ if (_b.h !== __styleValue$2) setStyleProperty(_b.a, "paddingBottom", __styleValue$2, "", _b.h);
61
+ if (_b.i !== __styleValue$3) setStyleProperty(_b.a, "paddingLeft", __styleValue$3, "", _b.i);
62
+ _b.d = __styleSpread;
63
+ }
64
+ _b.e = __styleFull;
65
+ _b.f = __styleValue;
66
+ _b.g = __styleValue$;
67
+ _b.h = __styleValue$2;
68
+ _b.i = __styleValue$3;
69
+ }
70
+ {
71
+ const _v = props.children;
72
+ _b.j = childTextHoleUpdate(__s, 1, _b.a, _v, _b.j, _b.k);
73
+ _b.k = _v;
74
+ }
75
+ });
76
+ //#endregion
77
+ export { SafeArea };
@@ -0,0 +1,43 @@
1
+ import { __s, bag6, clone, queueRefAttach, queueRefDetach, setStyle, template } from "octane";
2
+ import { childTextHoleUpdate, replaceRef, updateFreshClassName } from "octane/internal/client";
3
+ //#region src/KeyboardAvoiding.web.tsrx
4
+ var _t$0 = /* @__PURE__ */ template("<div></div>");
5
+ var _rm$1 = [
6
+ "r",
7
+ "b",
8
+ "a"
9
+ ];
10
+ function applyWebProps(node, bag) {
11
+ if (!node || !bag) return;
12
+ for (const [key, value] of Object.entries(bag)) if (key.includes("-")) node.setAttribute(key, String(value));
13
+ else node[key] = value;
14
+ }
15
+ var KeyboardAvoiding = /* @__PURE__ */ __s(function KeyboardAvoiding(props, __s, __extra) {
16
+ let _b = __s.slots[0];
17
+ if (_b === void 0) {
18
+ let _m0, _m1;
19
+ const _root = clone(_t$0);
20
+ queueRefAttach(__s, _m1 = (node) => applyWebProps(node, props.web), _m0 = _root);
21
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.b, _b.a));
22
+ _b = bag6(__s, _root, _m0, _m1, void 0, void 0, null, void 0);
23
+ __s.refFields = _rm$1;
24
+ } else {
25
+ const _r = (node) => applyWebProps(node, props.web);
26
+ if (_r !== _b.b) _b.b = replaceRef(__s, _b.b, _r, _b.a);
27
+ }
28
+ _b.c = updateFreshClassName(["vx-keyboard-avoiding", props.className], _b.c, _b.a);
29
+ {
30
+ const _v = props.style;
31
+ if (_b.d !== _v) {
32
+ setStyle(_b.a, _v, _b.d);
33
+ _b.d = _v;
34
+ }
35
+ }
36
+ {
37
+ const _v = props.children;
38
+ _b.e = childTextHoleUpdate(__s, 1, _b.a, _v, _b.e, _b.f);
39
+ _b.f = _v;
40
+ }
41
+ });
42
+ //#endregion
43
+ export { KeyboardAvoiding };
@@ -0,0 +1,67 @@
1
+ import { __s, bag3, bag8, child, clone, drainFrag, ifBlock, queueRefAttach, queueRefDetach, setStyle, sibling, template } from "octane";
2
+ import { childTextHoleUpdate, replaceRef, updateFreshClassName } from "octane/internal/client";
3
+ //#region src/Drawer.web.tsrx
4
+ var _t$0 = /* @__PURE__ */ template("<div class=\"vx-drawer-backdrop\" aria-hidden=\"true\"></div><div class=\"vx-drawer-panel\"></div>", 0, 1);
5
+ var _t$1 = /* @__PURE__ */ template("<div><div class=\"vx-drawer-main\"></div><!></div>");
6
+ function __then$1(__props, __s, __extra) {
7
+ const __block = __s.block;
8
+ const props = __extra[0];
9
+ let _b = __s.slots[0];
10
+ if (_b === void 0) {
11
+ let _m0;
12
+ const _root = clone(_t$0);
13
+ _m0 = sibling(child(_root), 1);
14
+ drainFrag(_root, __block.parentNode, __block.endMarker);
15
+ _b = bag3(__s, null, _m0, null, void 0);
16
+ }
17
+ {
18
+ const _v = props.drawer;
19
+ _b.b = childTextHoleUpdate(__s, 1, _b.a, _v, _b.b, _b.c);
20
+ _b.c = _v;
21
+ }
22
+ }
23
+ var _rm$4 = [
24
+ "r",
25
+ "b",
26
+ "a"
27
+ ];
28
+ function applyWebProps(node, bag) {
29
+ if (!node || !bag) return;
30
+ for (const [key, value] of Object.entries(bag)) if (key.includes("-")) node.setAttribute(key, String(value));
31
+ else node[key] = value;
32
+ }
33
+ var Drawer = /* @__PURE__ */ __s(function Drawer(props, __s, __extra) {
34
+ let _b = __s.slots[0];
35
+ if (_b === void 0) {
36
+ let _m0, _m1, _m4, _m5;
37
+ const _root = clone(_t$1);
38
+ queueRefAttach(__s, _m1 = (node) => applyWebProps(node, props.web), _m0 = _root);
39
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.b, _b.a));
40
+ _m4 = sibling(child(_root), 1);
41
+ _m5 = child(_root);
42
+ _b = bag8(__s, _root, _m0, _m1, void 0, void 0, _m4, _m5, null, void 0);
43
+ __s.refFields = _rm$4;
44
+ } else {
45
+ const _r = (node) => applyWebProps(node, props.web);
46
+ if (_r !== _b.b) _b.b = replaceRef(__s, _b.b, _r, _b.a);
47
+ }
48
+ _b.c = updateFreshClassName(["vx-drawer", props.className], _b.c, _b.a);
49
+ {
50
+ const _v = props.style;
51
+ if (_b.d !== _v) {
52
+ setStyle(_b.a, _v, _b.d);
53
+ _b.d = _v;
54
+ }
55
+ }
56
+ {
57
+ const _v = props.main;
58
+ _b.g = childTextHoleUpdate(__s, 1, _b.f, _v, _b.g, _b.h);
59
+ _b.h = _v;
60
+ }
61
+ {
62
+ const __ifCondition = props.open;
63
+ ifBlock(__s, 2, _b.a, __ifCondition, __then$1, null, _b.e, __ifCondition ? [props] : void 0);
64
+ }
65
+ });
66
+ //#endregion
67
+ export { Drawer };
@@ -0,0 +1,9 @@
1
+ //#region src/platformProps.web.ts
2
+ /** Apply a web escape-hatch bag after the primitive's standard props. */
3
+ function applyWebProps(el, props) {
4
+ if (!el || !props) return;
5
+ for (const [name, value] of Object.entries(props)) if (name.includes("-")) el.setAttribute(name, String(value));
6
+ else el[name] = value;
7
+ }
8
+ //#endregion
9
+ export { applyWebProps };
@@ -0,0 +1,45 @@
1
+ import { applyWebProps } from "./ui35.js";
2
+ import { bag5, clone, ifBlock, queueRefAttach, queueRefDetach, setStyle, template } from "octane";
3
+ import { bindSignalAttribute, enableSignalBindings, replaceRef, updateFreshClassName } from "octane/internal/client";
4
+ //#region src/ActivityIndicator.web.tsrx
5
+ enableSignalBindings(1, true);
6
+ var _t$0 = /* @__PURE__ */ template("<div role=\"progressbar\"></div>");
7
+ var _rm$1 = [
8
+ "r",
9
+ "e",
10
+ "b"
11
+ ];
12
+ function __then$0(__props, __s, __extra) {
13
+ const props = __extra[0];
14
+ let _b = __s.slots[0];
15
+ if (_b === void 0) {
16
+ let _m1, _m4;
17
+ const _root = clone(_t$0);
18
+ _m1 = _root;
19
+ queueRefAttach(__s, _m4 = (el) => applyWebProps(el, props.web), _m1);
20
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.e, _b.b));
21
+ _b = bag5(__s, _root, void 0, _m1, void 0, void 0, _m4);
22
+ __s.refFields = _rm$1;
23
+ } else {
24
+ const _r = (el) => applyWebProps(el, props.web);
25
+ if (_r !== _b.e) _b.e = replaceRef(__s, _b.e, _r, _b.b);
26
+ }
27
+ _b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:718dded3", "attr");
28
+ _b.c = updateFreshClassName(["vx-spinner", props.className], _b.c, _b.b);
29
+ {
30
+ const _v = props.style;
31
+ if (_b.d !== _v) {
32
+ setStyle(_b.b, _v, _b.d);
33
+ _b.d = _v;
34
+ }
35
+ }
36
+ }
37
+ var ActivityIndicator = function ActivityIndicator(props, __s, __extra) {
38
+ const __block = __s.block;
39
+ {
40
+ const __ifCondition = !(props.busy === false);
41
+ ifBlock(__s, 0, __block.parentNode, __ifCondition, __then$0, null, __block.endMarker, __ifCondition ? [props] : void 0);
42
+ }
43
+ };
44
+ //#endregion
45
+ export { ActivityIndicator };
@@ -0,0 +1,47 @@
1
+ import { applyWebProps } from "./ui35.js";
2
+ import { __s, bag9, clone, delegateEvents, queueRefAttach, queueRefDetach, setEventHandler, setStyle, template } from "octane";
3
+ import { bindSignalAttribute, bindSignalValue, enableSignalBindings, replaceRef, updateFreshClassName } from "octane/internal/client";
4
+ //#region src/Slider.web.tsrx
5
+ enableSignalBindings(1, true);
6
+ delegateEvents(["input"]);
7
+ var _t$0 = /* @__PURE__ */ template("<input type=\"range\" data-octane-input=\"i:c0018a58\"/>");
8
+ var _rm$0 = [
9
+ "r",
10
+ "i",
11
+ "b"
12
+ ];
13
+ var Slider = /* @__PURE__ */ __s(function Slider(props, __s, __extra) {
14
+ let _b = __s.slots[0];
15
+ if (_b === void 0) {
16
+ let _m1, _m4, _m8;
17
+ const _root = clone(_t$0);
18
+ _m1 = _root;
19
+ _m4 = bindSignalValue(__s, void 0, _root, props.value, "i:c0018a58");
20
+ setEventHandler(_root, "$$input", (e) => props.onValueChange?.(Number(e.target.value)));
21
+ queueRefAttach(__s, _m8 = (el) => applyWebProps(el, props.web), _m1);
22
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.i, _b.b));
23
+ _b = bag9(__s, _root, void 0, _m1, void 0, void 0, _m4, void 0, void 0, void 0, _m8);
24
+ __s.refFields = _rm$0;
25
+ } else {
26
+ _b.e = bindSignalValue(__s, _b.e, _b.b, props.value, "i:c0018a58");
27
+ setEventHandler(_b.b, "$$input", (e) => props.onValueChange?.(Number(e.target.value)));
28
+ {
29
+ const _r = (el) => applyWebProps(el, props.web);
30
+ if (_r !== _b.i) _b.i = replaceRef(__s, _b.i, _r, _b.b);
31
+ }
32
+ }
33
+ _b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:97ef4e10", "attr");
34
+ _b.c = updateFreshClassName(["vx-slider", props.className], _b.c, _b.b);
35
+ {
36
+ const _v = props.style;
37
+ if (_b.d !== _v) {
38
+ setStyle(_b.b, _v, _b.d);
39
+ _b.d = _v;
40
+ }
41
+ }
42
+ _b.f = bindSignalAttribute(__s, _b.f, _b.b, "min", props.minValue ?? 0, "b:7991c980", "attr");
43
+ _b.g = bindSignalAttribute(__s, _b.g, _b.b, "max", props.maxValue ?? 100, "b:ff7f1a7c", "attr");
44
+ _b.h = bindSignalAttribute(__s, _b.h, _b.b, "disabled", props.disabled, "b:91d4cdb7", "booleanAttr");
45
+ });
46
+ //#endregion
47
+ export { Slider };
@@ -0,0 +1,17 @@
1
+ //#region src/icons.ts
2
+ /**
3
+ * App-owned icon registry. `svg` is SVG path `d` data (not a full SVG
4
+ * markup string). Native `font` glyphs render only when the app ships that font.
5
+ */
6
+ var icons = /* @__PURE__ */ new Map();
7
+ function registerIcon(name, glyph) {
8
+ icons.set(name, glyph);
9
+ }
10
+ function registerIcons(record) {
11
+ for (const [name, glyph] of Object.entries(record)) icons.set(name, glyph);
12
+ }
13
+ function getIcon(name) {
14
+ return icons.get(name);
15
+ }
16
+ //#endregion
17
+ export { getIcon, registerIcon, registerIcons };
@@ -0,0 +1,100 @@
1
+ import { applyWebProps } from "./ui35.js";
2
+ import { getIcon } from "./ui38.js";
3
+ import { bag8, bag9, clone, hookSlots, ifBlock, queueRefAttach, queueRefDetach, template } from "octane";
4
+ import { bindSignalAttribute, compilerMemoRegion, createElementFromConfig, enableSignalBindings, hookMemoCreate, hookMemoEqual, hookMemoPublish1, replaceRef, updateFreshClassAttr, updateFreshClassName } from "octane/internal/client";
5
+ //#region src/Icon.web.tsrx
6
+ enableSignalBindings(1, true);
7
+ var _t$0 = /* @__PURE__ */ template("<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path></path></svg>", 1);
8
+ var _t$1 = /* @__PURE__ */ template("<img/>");
9
+ var _rm$1 = [
10
+ "r",
11
+ "f",
12
+ "b"
13
+ ];
14
+ function __then$0(__props, __s, __extra) {
15
+ const glyph = __extra[0];
16
+ const props = __extra[1];
17
+ const size = __extra[2];
18
+ let _b = __s.slots[0];
19
+ if (_b === void 0) {
20
+ let _m1, _m5, _m7;
21
+ const _root = clone(_t$0);
22
+ _m1 = _root;
23
+ queueRefAttach(__s, _m5 = (el) => applyWebProps(el, props.web), _m1);
24
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.f, _b.b));
25
+ _m7 = _root.firstChild;
26
+ _b = bag9(__s, _root, void 0, _m1, void 0, void 0, void 0, _m5, void 0, _m7, void 0);
27
+ __s.refFields = _rm$1;
28
+ } else {
29
+ const _r = (el) => applyWebProps(el, props.web);
30
+ if (_r !== _b.f) _b.f = replaceRef(__s, _b.f, _r, _b.b);
31
+ }
32
+ _b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:c2998a08", "attr");
33
+ _b.c = updateFreshClassAttr(["vx-icon", props.className], _b.c, _b.b);
34
+ _b.d = bindSignalAttribute(__s, _b.d, _b.b, "width", size, "b:2cb24e58", "attr");
35
+ _b.e = bindSignalAttribute(__s, _b.e, _b.b, "height", size, "b:030dffd1", "attr");
36
+ _b.g = bindSignalAttribute(__s, _b.g, _b.h, "d", glyph.svg, "b:87ff75cb", "attr");
37
+ _b.i = bindSignalAttribute(__s, _b.i, _b.h, "fill", props.color ?? "currentColor", "b:5bd1a218", "attr");
38
+ }
39
+ var _rm$4 = [
40
+ "r",
41
+ "h",
42
+ "b"
43
+ ];
44
+ function __then$3(__props, __s, __extra) {
45
+ const glyph = __extra[0];
46
+ const props = __extra[1];
47
+ const size = __extra[2];
48
+ let _b = __s.slots[0];
49
+ if (_b === void 0) {
50
+ let _m1, _m7;
51
+ const _root = clone(_t$1);
52
+ _m1 = _root;
53
+ queueRefAttach(__s, _m7 = (el) => applyWebProps(el, props.web), _m1);
54
+ (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.h, _b.b));
55
+ _b = bag8(__s, _root, void 0, _m1, void 0, void 0, void 0, void 0, void 0, _m7);
56
+ __s.refFields = _rm$4;
57
+ } else {
58
+ const _r = (el) => applyWebProps(el, props.web);
59
+ if (_r !== _b.h) _b.h = replaceRef(__s, _b.h, _r, _b.b);
60
+ }
61
+ _b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:e7755c5a", "attr");
62
+ _b.c = updateFreshClassName(["vx-icon", props.className], _b.c, _b.b);
63
+ _b.d = bindSignalAttribute(__s, _b.d, _b.b, "src", glyph.src, "b:c1db93e6", "attr");
64
+ _b.e = bindSignalAttribute(__s, _b.e, _b.b, "width", size, "b:ea1c538f", "attr");
65
+ _b.f = bindSignalAttribute(__s, _b.f, _b.b, "height", size, "b:a3678376", "attr");
66
+ _b.g = bindSignalAttribute(__s, _b.g, _b.b, "alt", props.name, "b:056826c3", "attr");
67
+ }
68
+ function __else$2(__props, __s, __extra) {
69
+ const __block = __s.block;
70
+ const glyph = __extra[0];
71
+ __extra[1];
72
+ __extra[2];
73
+ ifBlock(__s, 0, __block.parentNode, glyph.src, __then$3, null, __block.endMarker, __extra);
74
+ }
75
+ function _frag$0(props, __s, __extra) {
76
+ const __block = __s.block;
77
+ ifBlock(__s, 0, __block.parentNode, props.h0, props.h1, props.h2, __block.endMarker, props.h3);
78
+ }
79
+ var _hs$ = /* @__PURE__ */ hookSlots(5);
80
+ var Icon = function Icon(props, __s, __extra) {
81
+ const __memoRegion = compilerMemoRegion(__s, _hs$ + 0);
82
+ let __hk = __memoRegion.hooks;
83
+ if (__hk === void 0) __memoRegion.hooks = __hk = hookMemoCreate(3);
84
+ let __hkd0;
85
+ const glyph = (__hkd0 = props, __hk[0] !== true || !hookMemoEqual(__hk[1], __hkd0) ? hookMemoPublish1(__hk, 0, getIcon(props.name), __hkd0) : __hk[2]);
86
+ if (!glyph) return null;
87
+ const size = props.size ?? 24;
88
+ return createElementFromConfig("c:96c53b1e", _frag$0, {
89
+ h0: glyph.svg,
90
+ h1: __then$0,
91
+ h2: __else$2,
92
+ h3: [
93
+ glyph,
94
+ props,
95
+ size
96
+ ]
97
+ });
98
+ };
99
+ //#endregion
100
+ export { Icon };
package/dist/web/ui4.js CHANGED
@@ -1,25 +1,153 @@
1
- import { __s, bag5, clone, setStyle, template } from "octane";
2
- import { bindSignalAttribute, bindSignalChild, enableSignalBindings } from "octane/internal/client";
3
- //#region src/Text.web.tsrx
1
+ import { applyEscapeProps } from "./ui2.js";
2
+ import { layoutChildProps } from "./ui3.js";
3
+ import { __s, bag8, clone, hookSlots, snapshotSpread, template, useEffect, useRef } from "octane";
4
+ import { bindSignalChild, bindSignalHostPropSources, enableSignalBindings } from "octane/internal/client";
5
+ //#region src/View.web.tsrx
4
6
  enableSignalBindings(1, true);
5
- var _t$0 = /* @__PURE__ */ template("<span></span>");
6
- var Text = /* @__PURE__ */ __s(function Text(props, __s, __extra) {
7
+ var _t$0 = /* @__PURE__ */ template("<div></div>");
8
+ var _hs$ = /* @__PURE__ */ hookSlots(2);
9
+ var _rm$1 = [
10
+ "s",
11
+ "f",
12
+ "e"
13
+ ];
14
+ var View = /* @__PURE__ */ __s(function View(props, __s, __extra) {
15
+ const el = useRef(null, _hs$ + 0);
16
+ useEffect(() => {
17
+ const node = el.current;
18
+ const cb = props.onPan;
19
+ if (!node || !cb) return;
20
+ let sx = 0, sy = 0, active = false, last = 0, lx = 0, t0 = 0;
21
+ const emit = (e, state) => {
22
+ const now = performance.now();
23
+ const dt = Math.max(now - t0, 1) / 1e3;
24
+ const vx = (e.clientX - lx) / dt;
25
+ const vy = (e.clientY - last) / dt;
26
+ lx = e.clientX;
27
+ last = e.clientY;
28
+ t0 = now;
29
+ cb({
30
+ x: e.clientX - sx,
31
+ y: e.clientY - sy,
32
+ dx: e.clientX - sx,
33
+ dy: e.clientY - sy,
34
+ vx,
35
+ vy,
36
+ state,
37
+ target: node
38
+ });
39
+ };
40
+ const down = (e) => {
41
+ active = true;
42
+ sx = e.clientX;
43
+ sy = e.clientY;
44
+ t0 = performance.now();
45
+ lx = sx;
46
+ last = sy;
47
+ node.setPointerCapture?.(e.pointerId);
48
+ emit(e, "began");
49
+ };
50
+ const move = (e) => {
51
+ if (active) emit(e, "moved");
52
+ };
53
+ const up = (e) => {
54
+ if (active) {
55
+ active = false;
56
+ emit(e, "ended");
57
+ }
58
+ };
59
+ const cancel = (e) => {
60
+ if (active) {
61
+ active = false;
62
+ emit(e, "cancelled");
63
+ }
64
+ };
65
+ node.addEventListener("pointerdown", down);
66
+ node.addEventListener("pointermove", move);
67
+ node.addEventListener("pointerup", up);
68
+ node.addEventListener("pointercancel", cancel);
69
+ return () => {
70
+ node.removeEventListener("pointerdown", down);
71
+ node.removeEventListener("pointermove", move);
72
+ node.removeEventListener("pointerup", up);
73
+ node.removeEventListener("pointercancel", cancel);
74
+ };
75
+ }, [props.onPan], _hs$ + 1);
7
76
  let _b = __s.slots[0];
8
77
  if (_b === void 0) {
9
- let _m1;
78
+ let _m0, _m1, _m2, _m3, _m4, _m5;
10
79
  const _root = clone(_t$0);
11
- _m1 = _root;
12
- _b = bag5(__s, _root, void 0, _m1, void 0, null, void 0);
13
- }
14
- _b.a = bindSignalAttribute(__s, _b.a, _b.b, "class", props.className, "b:14d3594c", "class");
15
- {
16
- const _v = props.style;
17
- if (_b.c !== _v) {
18
- setStyle(_b.b, _v, _b.c);
19
- _b.c = _v;
80
+ _m0 = props.id;
81
+ _m1 = (e) => {
82
+ el.current = e;
83
+ if (e) {
84
+ applyEscapeProps(e, props);
85
+ props.bind?.(e);
86
+ }
87
+ };
88
+ _m2 = ["vx-view", props.className];
89
+ _m3 = snapshotSpread(layoutChildProps(props));
90
+ _m4 = _root;
91
+ _m5 = bindSignalHostPropSources(__s, void 0, _root, [
92
+ [
93
+ false,
94
+ "id",
95
+ _m0
96
+ ],
97
+ [
98
+ false,
99
+ "ref",
100
+ _m1
101
+ ],
102
+ [
103
+ false,
104
+ "className",
105
+ _m2
106
+ ],
107
+ [true, _m3]
108
+ ], "b:3f348e03", true);
109
+ _b = bag8(__s, _root, _m0, _m1, _m2, _m3, _m4, _m5, null, void 0);
110
+ __s.refFields = _rm$1;
111
+ } else {
112
+ {
113
+ const _v = props.id;
114
+ if (_b.a !== _v) _b.a = _v;
115
+ }
116
+ {
117
+ const _v = (e) => {
118
+ el.current = e;
119
+ if (e) {
120
+ applyEscapeProps(e, props);
121
+ props.bind?.(e);
122
+ }
123
+ };
124
+ if (_b.b !== _v) _b.b = _v;
125
+ }
126
+ {
127
+ const _v = ["vx-view", props.className];
128
+ if (_b.c !== _v) _b.c = _v;
20
129
  }
130
+ _b.d = snapshotSpread(layoutChildProps(props));
131
+ _b.f = bindSignalHostPropSources(__s, _b.f, _b.e, [
132
+ [
133
+ false,
134
+ "id",
135
+ _b.a
136
+ ],
137
+ [
138
+ false,
139
+ "ref",
140
+ _b.b
141
+ ],
142
+ [
143
+ false,
144
+ "className",
145
+ _b.c
146
+ ],
147
+ [true, _b.d]
148
+ ], "b:3f348e03", true);
21
149
  }
22
- _b.f = bindSignalChild(__s, _b.f, 1, _b.b, props.children, "b:79e388b8", null, void 0, void 0, void 0, true);
150
+ _b.i = bindSignalChild(__s, _b.i, 1, _b.e, props.children, "b:35b9af07", null, void 0, void 0, void 0, true);
23
151
  });
24
152
  //#endregion
25
- export { Text };
153
+ export { View };
@@ -0,0 +1,41 @@
1
+ import { applyWebProps } from "./ui35.js";
2
+ import { bag4, child, clone, componentSlot, drainFrag, markChildrenBlock, template } from "octane";
3
+ import { textHoleUpdate } from "octane/internal/client";
4
+ //#region src/Heading.web.tsrx
5
+ var _t$0 = /* @__PURE__ */ template("<!>", 0, 1);
6
+ var __childrenBody = {};
7
+ var Heading = function Heading(props, __s, __extra) {
8
+ const __block = __s.block;
9
+ const level = props.level ?? 2;
10
+ const tag = `h${level}`;
11
+ function __children$1(__props, __s, __extra) {
12
+ const __block = __s.block;
13
+ let _b = __s.slots[0];
14
+ if (_b === void 0) {
15
+ let _m0, _m1;
16
+ const _root = clone(_t$0);
17
+ _m0 = __block.parentNode;
18
+ _m1 = child(_root);
19
+ drainFrag(_root, __block.parentNode, __block.endMarker);
20
+ _b = bag4(__s, null, _m0, _m1, null, void 0);
21
+ }
22
+ {
23
+ const _v = props.children;
24
+ _b.c = textHoleUpdate(__s, 1, _b.a, _v, _b.c, _b.d, _b.b, true, true);
25
+ _b.d = _v;
26
+ }
27
+ }
28
+ componentSlot(__s, 0, __block.parentNode, tag, {
29
+ "id": props.id,
30
+ "className": [
31
+ "vx-heading",
32
+ `vx-h${level}`,
33
+ props.className
34
+ ],
35
+ "style": props.style,
36
+ "ref": (el) => applyWebProps(el, props.web),
37
+ "children": markChildrenBlock(__children$1, __childrenBody)
38
+ }, __block.endMarker, void 0, void 0, true, void 0, "c:4d3be985");
39
+ };
40
+ //#endregion
41
+ export { Heading };
@@ -0,0 +1,17 @@
1
+ import { __s, bag2, clone, template } from "octane";
2
+ import { bindSignalAttribute, enableSignalBindings } from "octane/internal/client";
3
+ //#region src/PlatformBadge.web.tsrx
4
+ enableSignalBindings(1, true);
5
+ var _t$0 = /* @__PURE__ */ template("<span>web</span>");
6
+ var PlatformBadge = /* @__PURE__ */ __s(function PlatformBadge(props, __s, __extra) {
7
+ let _b = __s.slots[0];
8
+ if (_b === void 0) {
9
+ let _m1;
10
+ const _root = clone(_t$0);
11
+ _m1 = _root;
12
+ _b = bag2(__s, _root, void 0, _m1);
13
+ }
14
+ _b.a = bindSignalAttribute(__s, _b.a, _b.b, "class", props.className, "b:f3cb9a4b", "class");
15
+ });
16
+ //#endregion
17
+ export { PlatformBadge };