@krak-stack/registry 0.11.7 → 0.11.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/README.md +39 -0
- package/dist/components/app-switcher/html.d.ts +2 -2
- package/dist/components/asset-input/html.d.ts +70 -0
- package/dist/components/asset-input/html.js +1549 -0
- package/dist/components/asset-input/index.d.ts +280 -0
- package/dist/components/asset-input/react.d.ts +32 -0
- package/dist/components/asset-input/react.js +2269 -0
- package/dist/components/asset-input/schema.d.ts +93 -0
- package/dist/components/asset-input/upload.d.ts +15 -0
- package/dist/components/asset-table/html.d.ts +110 -0
- package/dist/components/asset-table/html.js +4934 -0
- package/dist/components/asset-table/index.d.ts +225 -0
- package/dist/components/asset-table/react.d.ts +21 -0
- package/dist/components/asset-table/react.js +8241 -0
- package/dist/components/asset-table/schema.d.ts +73 -0
- package/dist/components/audit-log-table/html.js +47 -13
- package/dist/components/audit-log-table/react.js +36 -12
- package/dist/components/copy-button/html.d.ts +2 -2
- package/dist/components/danger-confirmation/html.d.ts +2 -2
- package/dist/components/data-table/classes.d.ts +2 -0
- package/dist/components/data-table/html.d.ts +58 -0
- package/dist/components/data-table/html.js +47 -13
- package/dist/components/data-table/index.d.ts +51 -1
- package/dist/components/data-table/react.d.ts +1 -0
- package/dist/components/data-table/react.js +36 -12
- package/dist/components/data-table/schema.d.ts +93 -3
- package/dist/components/date-input/html.d.ts +2 -2
- package/dist/components/docs/html.js +22 -4
- package/dist/components/docs/react.js +33 -2
- package/dist/components/editable-text/html.d.ts +2 -2
- package/dist/components/editing-locale-switcher/html.d.ts +2 -2
- package/dist/components/effect-form/react.js +343 -138
- package/dist/components/file-input/classes.d.ts +1 -1
- package/dist/components/file-input/file-type.d.ts +1 -0
- package/dist/components/file-input/html.d.ts +8 -1
- package/dist/components/file-input/html.js +170 -12
- package/dist/components/file-input/index.d.ts +1 -0
- package/dist/components/file-input/react.d.ts +9 -1
- package/dist/components/file-input/react.js +277 -127
- package/dist/components/file-input/schema.d.ts +1 -0
- package/dist/components/form/react.d.ts +5 -5
- package/dist/components/form/react.js +343 -138
- package/dist/components/icon-input/html.js +19 -5
- package/dist/components/icon-input/react.js +70 -13
- package/dist/components/locale-switcher/html.d.ts +2 -2
- package/dist/components/map-menu/html.d.ts +10 -4
- package/dist/components/map-menu/html.js +13 -8
- package/dist/components/map-menu/index.d.ts +5 -4
- package/dist/components/map-menu/react.d.ts +28 -17
- package/dist/components/map-menu/react.js +84 -178
- package/dist/components/map-menu/schema.d.ts +6 -0
- package/dist/components/map-menu/shared.d.ts +4 -0
- package/dist/components/permissions-input/classes.d.ts +8 -0
- package/dist/components/permissions-input/html.d.ts +41 -0
- package/dist/components/permissions-input/html.js +130 -0
- package/dist/components/permissions-input/index.d.ts +80 -0
- package/dist/components/permissions-input/react.d.ts +7 -0
- package/dist/components/permissions-input/react.js +201 -0
- package/dist/components/permissions-input/schema.d.ts +33 -0
- package/dist/components/phone-number-input/html.js +48 -14
- package/dist/components/phone-number-input/react.js +67 -10
- package/dist/components/presence-transition/index.d.ts +2 -2
- package/dist/components/search-menu/html.d.ts +2 -2
- package/dist/components/sidebar-layout/html.d.ts +3 -2
- package/dist/components/sidebar-layout/html.js +20 -2
- package/dist/components/sidebar-layout/index.d.ts +1 -0
- package/dist/components/sidebar-layout/react.js +33 -2
- package/dist/components/time-input/html.d.ts +2 -2
- package/dist/components/timezone-input/html.js +48 -14
- package/dist/components/timezone-input/react.js +67 -10
- package/dist/components/tracking-notice/html.d.ts +4 -4
- package/dist/components/tracking-notice/index.d.ts +2 -2
- package/dist/components/upload-attachment/classes.d.ts +3 -2
- package/dist/components/upload-attachment/html.d.ts +1 -1
- package/dist/components/upload-attachment/html.js +7 -5
- package/dist/components/upload-attachment/react.d.ts +3 -1
- package/dist/components/upload-attachment/react.js +25 -17
- package/dist/components/virtualized-combobox/classes.d.ts +12 -0
- package/dist/components/virtualized-combobox/html.d.ts +45 -3
- package/dist/components/virtualized-combobox/html.js +48 -14
- package/dist/components/virtualized-combobox/index.d.ts +55 -4
- package/dist/components/virtualized-combobox/react.d.ts +6 -2
- package/dist/components/virtualized-combobox/react.js +67 -10
- package/dist/components/virtualized-combobox/schema.d.ts +60 -4
- package/dist/components/webhook-delivery-table/html.js +47 -13
- package/dist/components/webhook-delivery-table/react.js +36 -12
- package/dist/lib/access/index.d.ts +61 -0
- package/dist/lib/access/index.js +92 -0
- package/dist/lib/access/table/classes.d.ts +13 -0
- package/dist/lib/access/table/html.d.ts +39 -0
- package/dist/lib/access/table/html.js +157 -0
- package/dist/lib/access/table/index.d.ts +32 -0
- package/dist/lib/access/table/react.d.ts +3 -0
- package/dist/lib/access/table/react.js +195 -0
- package/dist/lib/access/table/schema.d.ts +43 -0
- package/dist/lib/docs.integrations.server.js +23 -1
- package/dist/lib/docs.js +33 -2
- package/dist/lib/docs.server.js +29 -2
- package/dist/lib/documentation-toolkit.js +23 -1
- package/dist/lib/effect-ui-adapter/use-model.d.ts +1 -1
- package/dist/lib/effect-ui-adapter/use-model.js +19 -11
- package/dist/lib/lucide-effect.d.ts +19 -19
- package/dist/lib/lucide-effect.js +38 -38
- package/dist/services/assets/library.d.ts +221 -0
- package/dist/services/assets/schema.d.ts +3 -0
- package/dist/services/assets/url.d.ts +12 -0
- package/dist/services/assets/use-library.d.ts +20 -0
- package/package.json +13 -1
|
@@ -263,8 +263,9 @@ var SearchModel = Component4.define(searchMenuStateOptions).make({
|
|
|
263
263
|
view: () => View2.text("")
|
|
264
264
|
});
|
|
265
265
|
// ../../src/components/sidebar-layout/react.tsx
|
|
266
|
-
import { Link, Outlet } from "@tanstack/react-router";
|
|
266
|
+
import { Link, Outlet, ScriptOnce } from "@tanstack/react-router";
|
|
267
267
|
import { Component as Component6, View as View3 } from "effect/ui";
|
|
268
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef3 } from "react";
|
|
268
269
|
import { useModel as useModel3 } from "@krak-stack/registry/effect-ui-adapter/react";
|
|
269
270
|
import { Badge } from "@/components/ui/badge";
|
|
270
271
|
import {
|
|
@@ -350,6 +351,22 @@ var SidebarOpenCookie = Schema6.Literals(["true", "false"]).annotate({
|
|
|
350
351
|
identifier: "SidebarOpenCookie"
|
|
351
352
|
});
|
|
352
353
|
var getSidebarDefaultOpen = (defaultOpen) => Schema6.decodeUnknownOption(SidebarOpenCookie)(Cookies.parseHeader(globalThis.document?.cookie ?? "")[cookieName]).pipe(Option.map((value) => value === "true"), Option.getOrElse(() => defaultOpen));
|
|
354
|
+
var centerActiveSidebarLink = (sidebar) => {
|
|
355
|
+
if (!sidebar?.clientHeight)
|
|
356
|
+
return;
|
|
357
|
+
let active;
|
|
358
|
+
for (const link of sidebar.querySelectorAll('a[aria-current="page"]')) {
|
|
359
|
+
if (!link.getClientRects().length)
|
|
360
|
+
continue;
|
|
361
|
+
if (!active || link.pathname.length > active.pathname.length)
|
|
362
|
+
active = link;
|
|
363
|
+
}
|
|
364
|
+
if (!active)
|
|
365
|
+
return;
|
|
366
|
+
const link = active.getBoundingClientRect();
|
|
367
|
+
const sidebarTop = sidebar.getBoundingClientRect().top;
|
|
368
|
+
sidebar.scrollTop += link.top + link.height / 2 - (sidebarTop + sidebar.clientHeight / 2);
|
|
369
|
+
};
|
|
353
370
|
var SidebarLayoutMessage = UiSchema3.TaggedEnum({
|
|
354
371
|
SetOpen: { open: Schema6.Boolean },
|
|
355
372
|
SetMobileOpen: { open: Schema6.Boolean },
|
|
@@ -389,6 +406,11 @@ var SidebarModel = Component6.define(sidebarLayoutOptions).make({
|
|
|
389
406
|
...sidebarLayoutBehaviours,
|
|
390
407
|
view: () => View3.text("")
|
|
391
408
|
});
|
|
409
|
+
var sidebarScrollScript = `requestAnimationFrame(
|
|
410
|
+
(${centerActiveSidebarLink.toString()}).bind(null,
|
|
411
|
+
document.currentScript.parentElement.querySelector(':scope > [data-slot="sidebar-content"]')
|
|
412
|
+
)
|
|
413
|
+
)`;
|
|
392
414
|
// ../../src/lib/docs.tsx
|
|
393
415
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
394
416
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
package/dist/lib/docs.js
CHANGED
|
@@ -797,8 +797,9 @@ function SearchMenu({
|
|
|
797
797
|
});
|
|
798
798
|
}
|
|
799
799
|
// ../../src/components/sidebar-layout/react.tsx
|
|
800
|
-
import { Link, Outlet } from "@tanstack/react-router";
|
|
800
|
+
import { Link, Outlet, ScriptOnce } from "@tanstack/react-router";
|
|
801
801
|
import { Component as Component6, View as View3 } from "effect/ui";
|
|
802
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef3 } from "react";
|
|
802
803
|
import { useModel as useModel3 } from "@krak-stack/registry/effect-ui-adapter/react";
|
|
803
804
|
import { Badge } from "@/components/ui/badge";
|
|
804
805
|
import {
|
|
@@ -888,6 +889,22 @@ var SidebarOpenCookie = Schema6.Literals(["true", "false"]).annotate({
|
|
|
888
889
|
identifier: "SidebarOpenCookie"
|
|
889
890
|
});
|
|
890
891
|
var getSidebarDefaultOpen = (defaultOpen) => Schema6.decodeUnknownOption(SidebarOpenCookie)(Cookies.parseHeader(globalThis.document?.cookie ?? "")[cookieName]).pipe(Option.map((value) => value === "true"), Option.getOrElse(() => defaultOpen));
|
|
892
|
+
var centerActiveSidebarLink = (sidebar) => {
|
|
893
|
+
if (!sidebar?.clientHeight)
|
|
894
|
+
return;
|
|
895
|
+
let active;
|
|
896
|
+
for (const link of sidebar.querySelectorAll('a[aria-current="page"]')) {
|
|
897
|
+
if (!link.getClientRects().length)
|
|
898
|
+
continue;
|
|
899
|
+
if (!active || link.pathname.length > active.pathname.length)
|
|
900
|
+
active = link;
|
|
901
|
+
}
|
|
902
|
+
if (!active)
|
|
903
|
+
return;
|
|
904
|
+
const link = active.getBoundingClientRect();
|
|
905
|
+
const sidebarTop = sidebar.getBoundingClientRect().top;
|
|
906
|
+
sidebar.scrollTop += link.top + link.height / 2 - (sidebarTop + sidebar.clientHeight / 2);
|
|
907
|
+
};
|
|
891
908
|
var SidebarLayoutMessage = UiSchema3.TaggedEnum({
|
|
892
909
|
SetOpen: { open: Schema6.Boolean },
|
|
893
910
|
SetMobileOpen: { open: Schema6.Boolean },
|
|
@@ -928,8 +945,18 @@ var SidebarModel = Component6.define(sidebarLayoutOptions).make({
|
|
|
928
945
|
...sidebarLayoutBehaviours,
|
|
929
946
|
view: () => View3.text("")
|
|
930
947
|
});
|
|
948
|
+
var sidebarScrollScript = `requestAnimationFrame(
|
|
949
|
+
(${centerActiveSidebarLink.toString()}).bind(null,
|
|
950
|
+
document.currentScript.parentElement.querySelector(':scope > [data-slot="sidebar-content"]')
|
|
951
|
+
)
|
|
952
|
+
)`;
|
|
931
953
|
function AppSidebar({ collapsible, footer, groups, header }) {
|
|
932
|
-
const { isMobile, setOpenMobile } = useSidebar();
|
|
954
|
+
const { isMobile, openMobile, setOpenMobile } = useSidebar();
|
|
955
|
+
const contentRef = useRef3(null);
|
|
956
|
+
const drawerOpen = isMobile && collapsible !== "none" && openMobile;
|
|
957
|
+
useLayoutEffect2(() => {
|
|
958
|
+
centerActiveSidebarLink(contentRef.current);
|
|
959
|
+
}, [isMobile, drawerOpen]);
|
|
933
960
|
const closeMobileSidebar = () => {
|
|
934
961
|
if (isMobile)
|
|
935
962
|
setOpenMobile(false);
|
|
@@ -941,6 +968,7 @@ function AppSidebar({ collapsible, footer, groups, header }) {
|
|
|
941
968
|
children: header
|
|
942
969
|
}),
|
|
943
970
|
/* @__PURE__ */ jsx6(SidebarContent, {
|
|
971
|
+
ref: contentRef,
|
|
944
972
|
className: "group-data-[collapsible=icon]:overflow-x-hidden group-data-[collapsible=icon]:overflow-y-auto",
|
|
945
973
|
children: groups.map((group) => /* @__PURE__ */ jsxs5(SidebarGroup, {
|
|
946
974
|
children: [
|
|
@@ -1012,6 +1040,9 @@ function AppSidebar({ collapsible, footer, groups, header }) {
|
|
|
1012
1040
|
footer ? /* @__PURE__ */ jsx6(SidebarFooter, {
|
|
1013
1041
|
children: footer
|
|
1014
1042
|
}) : null,
|
|
1043
|
+
/* @__PURE__ */ jsx6(ScriptOnce, {
|
|
1044
|
+
children: sidebarScrollScript
|
|
1045
|
+
}),
|
|
1015
1046
|
/* @__PURE__ */ jsx6(SidebarRail, {})
|
|
1016
1047
|
]
|
|
1017
1048
|
});
|
package/dist/lib/docs.server.js
CHANGED
|
@@ -263,8 +263,9 @@ var SearchModel = Component4.define(searchMenuStateOptions).make({
|
|
|
263
263
|
view: () => View2.text("")
|
|
264
264
|
});
|
|
265
265
|
// ../../src/components/sidebar-layout/react.tsx
|
|
266
|
-
import { Link, Outlet } from "@tanstack/react-router";
|
|
266
|
+
import { Link, Outlet, ScriptOnce } from "@tanstack/react-router";
|
|
267
267
|
import { Component as Component6, View as View3 } from "effect/ui";
|
|
268
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef3 } from "react";
|
|
268
269
|
import { useModel as useModel3 } from "@krak-stack/registry/effect-ui-adapter/react";
|
|
269
270
|
import { Badge } from "@/components/ui/badge";
|
|
270
271
|
import {
|
|
@@ -350,6 +351,22 @@ var SidebarOpenCookie = Schema6.Literals(["true", "false"]).annotate({
|
|
|
350
351
|
identifier: "SidebarOpenCookie"
|
|
351
352
|
});
|
|
352
353
|
var getSidebarDefaultOpen = (defaultOpen) => Schema6.decodeUnknownOption(SidebarOpenCookie)(Cookies.parseHeader(globalThis.document?.cookie ?? "")[cookieName]).pipe(Option.map((value) => value === "true"), Option.getOrElse(() => defaultOpen));
|
|
354
|
+
var centerActiveSidebarLink = (sidebar) => {
|
|
355
|
+
if (!sidebar?.clientHeight)
|
|
356
|
+
return;
|
|
357
|
+
let active;
|
|
358
|
+
for (const link of sidebar.querySelectorAll('a[aria-current="page"]')) {
|
|
359
|
+
if (!link.getClientRects().length)
|
|
360
|
+
continue;
|
|
361
|
+
if (!active || link.pathname.length > active.pathname.length)
|
|
362
|
+
active = link;
|
|
363
|
+
}
|
|
364
|
+
if (!active)
|
|
365
|
+
return;
|
|
366
|
+
const link = active.getBoundingClientRect();
|
|
367
|
+
const sidebarTop = sidebar.getBoundingClientRect().top;
|
|
368
|
+
sidebar.scrollTop += link.top + link.height / 2 - (sidebarTop + sidebar.clientHeight / 2);
|
|
369
|
+
};
|
|
353
370
|
var SidebarLayoutMessage = UiSchema3.TaggedEnum({
|
|
354
371
|
SetOpen: { open: Schema6.Boolean },
|
|
355
372
|
SetMobileOpen: { open: Schema6.Boolean },
|
|
@@ -389,6 +406,11 @@ var SidebarModel = Component6.define(sidebarLayoutOptions).make({
|
|
|
389
406
|
...sidebarLayoutBehaviours,
|
|
390
407
|
view: () => View3.text("")
|
|
391
408
|
});
|
|
409
|
+
var sidebarScrollScript = `requestAnimationFrame(
|
|
410
|
+
(${centerActiveSidebarLink.toString()}).bind(null,
|
|
411
|
+
document.currentScript.parentElement.querySelector(':scope > [data-slot="sidebar-content"]')
|
|
412
|
+
)
|
|
413
|
+
)`;
|
|
392
414
|
// ../../src/lib/docs.tsx
|
|
393
415
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
394
416
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
@@ -622,9 +644,14 @@ var compileMdxDocsPage = (sourceFile, source) => {
|
|
|
622
644
|
throw new Error(`Body title does not match frontmatter in ${sourceFile}`);
|
|
623
645
|
}
|
|
624
646
|
const body = bodySource.replace(/^\s*#\s+.+?\r?\n+/, "");
|
|
647
|
+
const compiled = compileDocsMarkdown(body);
|
|
648
|
+
if (frontmatter.path === "/docs/assets") {
|
|
649
|
+
const title = Bun.escapeHTML(frontmatter.title);
|
|
650
|
+
compiled.html = compiled.html.replace("<p>{{assets-api-reference}}</p>", () => `<iframe src="/api/assets/docs" title="${title}" loading="lazy" class="my-5 h-[min(72vh,52rem)] min-h-96 w-full rounded-lg border"></iframe>`);
|
|
651
|
+
}
|
|
625
652
|
return Schema8.decodeSync(DocsPageSchema)({
|
|
626
653
|
...frontmatter,
|
|
627
|
-
...
|
|
654
|
+
...compiled,
|
|
628
655
|
sourceFile
|
|
629
656
|
});
|
|
630
657
|
};
|
|
@@ -263,8 +263,9 @@ var SearchModel = Component4.define(searchMenuStateOptions).make({
|
|
|
263
263
|
view: () => View2.text("")
|
|
264
264
|
});
|
|
265
265
|
// ../../src/components/sidebar-layout/react.tsx
|
|
266
|
-
import { Link, Outlet } from "@tanstack/react-router";
|
|
266
|
+
import { Link, Outlet, ScriptOnce } from "@tanstack/react-router";
|
|
267
267
|
import { Component as Component6, View as View3 } from "effect/ui";
|
|
268
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef3 } from "react";
|
|
268
269
|
import { useModel as useModel3 } from "@krak-stack/registry/effect-ui-adapter/react";
|
|
269
270
|
import { Badge } from "@/components/ui/badge";
|
|
270
271
|
import {
|
|
@@ -350,6 +351,22 @@ var SidebarOpenCookie = Schema6.Literals(["true", "false"]).annotate({
|
|
|
350
351
|
identifier: "SidebarOpenCookie"
|
|
351
352
|
});
|
|
352
353
|
var getSidebarDefaultOpen = (defaultOpen) => Schema6.decodeUnknownOption(SidebarOpenCookie)(Cookies.parseHeader(globalThis.document?.cookie ?? "")[cookieName]).pipe(Option.map((value) => value === "true"), Option.getOrElse(() => defaultOpen));
|
|
354
|
+
var centerActiveSidebarLink = (sidebar) => {
|
|
355
|
+
if (!sidebar?.clientHeight)
|
|
356
|
+
return;
|
|
357
|
+
let active;
|
|
358
|
+
for (const link of sidebar.querySelectorAll('a[aria-current="page"]')) {
|
|
359
|
+
if (!link.getClientRects().length)
|
|
360
|
+
continue;
|
|
361
|
+
if (!active || link.pathname.length > active.pathname.length)
|
|
362
|
+
active = link;
|
|
363
|
+
}
|
|
364
|
+
if (!active)
|
|
365
|
+
return;
|
|
366
|
+
const link = active.getBoundingClientRect();
|
|
367
|
+
const sidebarTop = sidebar.getBoundingClientRect().top;
|
|
368
|
+
sidebar.scrollTop += link.top + link.height / 2 - (sidebarTop + sidebar.clientHeight / 2);
|
|
369
|
+
};
|
|
353
370
|
var SidebarLayoutMessage = UiSchema3.TaggedEnum({
|
|
354
371
|
SetOpen: { open: Schema6.Boolean },
|
|
355
372
|
SetMobileOpen: { open: Schema6.Boolean },
|
|
@@ -389,6 +406,11 @@ var SidebarModel = Component6.define(sidebarLayoutOptions).make({
|
|
|
389
406
|
...sidebarLayoutBehaviours,
|
|
390
407
|
view: () => View3.text("")
|
|
391
408
|
});
|
|
409
|
+
var sidebarScrollScript = `requestAnimationFrame(
|
|
410
|
+
(${centerActiveSidebarLink.toString()}).bind(null,
|
|
411
|
+
document.currentScript.parentElement.querySelector(':scope > [data-slot="sidebar-content"]')
|
|
412
|
+
)
|
|
413
|
+
)`;
|
|
392
414
|
// ../../src/lib/docs.tsx
|
|
393
415
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
394
416
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
@@ -106,7 +106,10 @@ var useModel = (component, props, options = {}) => {
|
|
|
106
106
|
const contextLog = useContext(ModelMessageLogContext);
|
|
107
107
|
const messageLog = options.messageLog ?? (contextLog === undefined ? MessageLog2.noop : contextLog);
|
|
108
108
|
const [store] = useState(() => {
|
|
109
|
-
const initial = {
|
|
109
|
+
const initial = {
|
|
110
|
+
component,
|
|
111
|
+
value: { model: component.init(props).model }
|
|
112
|
+
};
|
|
110
113
|
let snapshot = initial;
|
|
111
114
|
const listeners = new Set;
|
|
112
115
|
return {
|
|
@@ -118,31 +121,36 @@ var useModel = (component, props, options = {}) => {
|
|
|
118
121
|
},
|
|
119
122
|
getSnapshot: () => snapshot,
|
|
120
123
|
getServerSnapshot: () => initial,
|
|
121
|
-
publish: (next) => {
|
|
122
|
-
if ("model" in snapshot && "model" in next && Object.is(snapshot.model, next.model))
|
|
124
|
+
publish: (owner, next) => {
|
|
125
|
+
if (owner === snapshot.component && "model" in snapshot.value && "model" in next && Object.is(snapshot.value.model, next.model))
|
|
123
126
|
return;
|
|
124
|
-
if ("error" in snapshot && "error" in next && snapshot.error === next.error)
|
|
127
|
+
if (owner === snapshot.component && "error" in snapshot.value && "error" in next && snapshot.value.error === next.error)
|
|
125
128
|
return;
|
|
126
|
-
snapshot = next;
|
|
129
|
+
snapshot = { component: owner, value: next };
|
|
127
130
|
listeners.forEach((listener) => listener());
|
|
128
131
|
}
|
|
129
132
|
};
|
|
130
133
|
});
|
|
131
|
-
const
|
|
134
|
+
const current = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot);
|
|
135
|
+
const snapshot = current.component === component ? current.value : { model: component.init(props).model };
|
|
132
136
|
const committed = useRef(props);
|
|
133
137
|
const onEmit = useRef(options.onEmit);
|
|
134
138
|
const runtime = useRef(undefined);
|
|
135
|
-
const send = useCallback((message) =>
|
|
139
|
+
const send = useCallback((message) => {
|
|
140
|
+
if (runtime.current?.component === component)
|
|
141
|
+
runtime.current.mounted.send(message);
|
|
142
|
+
}, [component]);
|
|
136
143
|
useLayoutEffect(() => {
|
|
137
144
|
onEmit.current = options.onEmit;
|
|
138
145
|
committed.current = props;
|
|
139
|
-
runtime.current?.
|
|
140
|
-
|
|
146
|
+
if (runtime.current?.component === component)
|
|
147
|
+
runtime.current.mounted.setProps(props);
|
|
148
|
+
}, [component, props, options.onEmit]);
|
|
141
149
|
useEffect(() => {
|
|
142
150
|
if (messageLog === null)
|
|
143
151
|
return;
|
|
144
|
-
const mounted = mountModel(component, committed.current, store.publish, messageLog, (event) => onEmit.current?.(event));
|
|
145
|
-
runtime.current = mounted;
|
|
152
|
+
const mounted = mountModel(component, committed.current, (snapshot) => store.publish(component, snapshot), messageLog, (event) => onEmit.current?.(event));
|
|
153
|
+
runtime.current = { component, mounted };
|
|
146
154
|
return () => {
|
|
147
155
|
runtime.current = undefined;
|
|
148
156
|
mounted.dispose();
|
|
@@ -24,6 +24,25 @@ export declare const EyeOff: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, c
|
|
|
24
24
|
export declare const Ellipsis: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
25
25
|
export declare const FileJson: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
26
26
|
export declare const FileText: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
27
|
+
export declare const FolderOpen: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
28
|
+
export declare const Captions: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
29
|
+
export declare const FileArchive: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
30
|
+
export declare const Binary: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
31
|
+
export declare const BookOpen: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
32
|
+
export declare const Box: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
33
|
+
export declare const Contact: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
34
|
+
export declare const Database: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
35
|
+
export declare const Disc3: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
36
|
+
export declare const FileCode: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
37
|
+
export declare const FileTerminal: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
38
|
+
export declare const FileType: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
39
|
+
export declare const Globe: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
40
|
+
export declare const Package: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
41
|
+
export declare const Presentation: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
42
|
+
export declare const FileAudio: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
43
|
+
export declare const FileImage: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
44
|
+
export declare const FileSpreadsheet: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
45
|
+
export declare const FileVideo: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
27
46
|
export declare const GripVertical: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
28
47
|
export declare const Image: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
29
48
|
export declare const LayoutGrid: <Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">;
|
|
@@ -320,7 +339,6 @@ export declare const BetweenVerticalEnd: ReturnType<typeof createLucideIcon>;
|
|
|
320
339
|
export declare const BetweenVerticalStart: ReturnType<typeof createLucideIcon>;
|
|
321
340
|
export declare const BicepsFlexed: ReturnType<typeof createLucideIcon>;
|
|
322
341
|
export declare const Bike: ReturnType<typeof createLucideIcon>;
|
|
323
|
-
export declare const Binary: ReturnType<typeof createLucideIcon>;
|
|
324
342
|
export declare const Binoculars: ReturnType<typeof createLucideIcon>;
|
|
325
343
|
export declare const Biohazard: ReturnType<typeof createLucideIcon>;
|
|
326
344
|
export declare const Bird: ReturnType<typeof createLucideIcon>;
|
|
@@ -354,7 +372,6 @@ export declare const BookKey: ReturnType<typeof createLucideIcon>;
|
|
|
354
372
|
export declare const BookLock: ReturnType<typeof createLucideIcon>;
|
|
355
373
|
export declare const BookMarked: ReturnType<typeof createLucideIcon>;
|
|
356
374
|
export declare const BookMinus: ReturnType<typeof createLucideIcon>;
|
|
357
|
-
export declare const BookOpen: ReturnType<typeof createLucideIcon>;
|
|
358
375
|
export declare const BookOpenCheck: ReturnType<typeof createLucideIcon>;
|
|
359
376
|
export declare const BookOpenText: ReturnType<typeof createLucideIcon>;
|
|
360
377
|
export declare const BookPlus: ReturnType<typeof createLucideIcon>;
|
|
@@ -384,7 +401,6 @@ export declare const BottleWine: ReturnType<typeof createLucideIcon>;
|
|
|
384
401
|
export declare const BowArrow: ReturnType<typeof createLucideIcon>;
|
|
385
402
|
export declare const BowlChopsticks: ReturnType<typeof createLucideIcon>;
|
|
386
403
|
export declare const Bowling: ReturnType<typeof createLucideIcon>;
|
|
387
|
-
export declare const Box: ReturnType<typeof createLucideIcon>;
|
|
388
404
|
export declare const BoxDashed: ReturnType<typeof createLucideIcon>;
|
|
389
405
|
export declare const BoxSelect: ReturnType<typeof createLucideIcon>;
|
|
390
406
|
export declare const Boxes: ReturnType<typeof createLucideIcon>;
|
|
@@ -462,7 +478,6 @@ export declare const CandyOff: ReturnType<typeof createLucideIcon>;
|
|
|
462
478
|
export declare const Cannabis: ReturnType<typeof createLucideIcon>;
|
|
463
479
|
export declare const CannabisOff: ReturnType<typeof createLucideIcon>;
|
|
464
480
|
export declare const Cap: ReturnType<typeof createLucideIcon>;
|
|
465
|
-
export declare const Captions: ReturnType<typeof createLucideIcon>;
|
|
466
481
|
export declare const CaptionsOff: ReturnType<typeof createLucideIcon>;
|
|
467
482
|
export declare const Car: ReturnType<typeof createLucideIcon>;
|
|
468
483
|
export declare const CarBattery: ReturnType<typeof createLucideIcon>;
|
|
@@ -741,7 +756,6 @@ export declare const Computer: ReturnType<typeof createLucideIcon>;
|
|
|
741
756
|
export declare const ConciergeBell: ReturnType<typeof createLucideIcon>;
|
|
742
757
|
export declare const Cone: ReturnType<typeof createLucideIcon>;
|
|
743
758
|
export declare const Construction: ReturnType<typeof createLucideIcon>;
|
|
744
|
-
export declare const Contact: ReturnType<typeof createLucideIcon>;
|
|
745
759
|
export declare const Contact2: ReturnType<typeof createLucideIcon>;
|
|
746
760
|
export declare const ContactRound: ReturnType<typeof createLucideIcon>;
|
|
747
761
|
export declare const Container: ReturnType<typeof createLucideIcon>;
|
|
@@ -784,7 +798,6 @@ export declare const CurlyBraces: ReturnType<typeof createLucideIcon>;
|
|
|
784
798
|
export declare const Currency: ReturnType<typeof createLucideIcon>;
|
|
785
799
|
export declare const Cylinder: ReturnType<typeof createLucideIcon>;
|
|
786
800
|
export declare const Dam: ReturnType<typeof createLucideIcon>;
|
|
787
|
-
export declare const Database: ReturnType<typeof createLucideIcon>;
|
|
788
801
|
export declare const DatabaseArrowDown: ReturnType<typeof createLucideIcon>;
|
|
789
802
|
export declare const DatabaseArrowUp: ReturnType<typeof createLucideIcon>;
|
|
790
803
|
export declare const DatabaseBackup: ReturnType<typeof createLucideIcon>;
|
|
@@ -817,7 +830,6 @@ export declare const Dices: ReturnType<typeof createLucideIcon>;
|
|
|
817
830
|
export declare const Diff: ReturnType<typeof createLucideIcon>;
|
|
818
831
|
export declare const Disc: ReturnType<typeof createLucideIcon>;
|
|
819
832
|
export declare const Disc2: ReturnType<typeof createLucideIcon>;
|
|
820
|
-
export declare const Disc3: ReturnType<typeof createLucideIcon>;
|
|
821
833
|
export declare const DiscAlbum: ReturnType<typeof createLucideIcon>;
|
|
822
834
|
export declare const Divide: ReturnType<typeof createLucideIcon>;
|
|
823
835
|
export declare const DivideCircle: ReturnType<typeof createLucideIcon>;
|
|
@@ -897,8 +909,6 @@ export declare const Faucet: ReturnType<typeof createLucideIcon>;
|
|
|
897
909
|
export declare const Feather: ReturnType<typeof createLucideIcon>;
|
|
898
910
|
export declare const Fence: ReturnType<typeof createLucideIcon>;
|
|
899
911
|
export declare const FerrisWheel: ReturnType<typeof createLucideIcon>;
|
|
900
|
-
export declare const FileArchive: ReturnType<typeof createLucideIcon>;
|
|
901
|
-
export declare const FileAudio: ReturnType<typeof createLucideIcon>;
|
|
902
912
|
export declare const FileAudio2: ReturnType<typeof createLucideIcon>;
|
|
903
913
|
export declare const FileAxis3D: ReturnType<typeof createLucideIcon>;
|
|
904
914
|
export declare const FileAxis3d: ReturnType<typeof createLucideIcon>;
|
|
@@ -917,7 +927,6 @@ export declare const FileCheck: ReturnType<typeof createLucideIcon>;
|
|
|
917
927
|
export declare const FileCheck2: ReturnType<typeof createLucideIcon>;
|
|
918
928
|
export declare const FileCheckCorner: ReturnType<typeof createLucideIcon>;
|
|
919
929
|
export declare const FileClock: ReturnType<typeof createLucideIcon>;
|
|
920
|
-
export declare const FileCode: ReturnType<typeof createLucideIcon>;
|
|
921
930
|
export declare const FileCode2: ReturnType<typeof createLucideIcon>;
|
|
922
931
|
export declare const FileCodeCorner: ReturnType<typeof createLucideIcon>;
|
|
923
932
|
export declare const FileCog: ReturnType<typeof createLucideIcon>;
|
|
@@ -930,7 +939,6 @@ export declare const FileEdit: ReturnType<typeof createLucideIcon>;
|
|
|
930
939
|
export declare const FileExclamationPoint: ReturnType<typeof createLucideIcon>;
|
|
931
940
|
export declare const FileHeadphone: ReturnType<typeof createLucideIcon>;
|
|
932
941
|
export declare const FileHeart: ReturnType<typeof createLucideIcon>;
|
|
933
|
-
export declare const FileImage: ReturnType<typeof createLucideIcon>;
|
|
934
942
|
export declare const FileInput: ReturnType<typeof createLucideIcon>;
|
|
935
943
|
export declare const FileJson2: ReturnType<typeof createLucideIcon>;
|
|
936
944
|
export declare const FileKey: ReturnType<typeof createLucideIcon>;
|
|
@@ -959,16 +967,12 @@ export declare const FileSearchCorner: ReturnType<typeof createLucideIcon>;
|
|
|
959
967
|
export declare const FileSignal: ReturnType<typeof createLucideIcon>;
|
|
960
968
|
export declare const FileSignature: ReturnType<typeof createLucideIcon>;
|
|
961
969
|
export declare const FileSliders: ReturnType<typeof createLucideIcon>;
|
|
962
|
-
export declare const FileSpreadsheet: ReturnType<typeof createLucideIcon>;
|
|
963
970
|
export declare const FileStack: ReturnType<typeof createLucideIcon>;
|
|
964
971
|
export declare const FileSymlink: ReturnType<typeof createLucideIcon>;
|
|
965
|
-
export declare const FileTerminal: ReturnType<typeof createLucideIcon>;
|
|
966
972
|
export declare const FileTextSparkles: ReturnType<typeof createLucideIcon>;
|
|
967
|
-
export declare const FileType: ReturnType<typeof createLucideIcon>;
|
|
968
973
|
export declare const FileType2: ReturnType<typeof createLucideIcon>;
|
|
969
974
|
export declare const FileTypeCorner: ReturnType<typeof createLucideIcon>;
|
|
970
975
|
export declare const FileUser: ReturnType<typeof createLucideIcon>;
|
|
971
|
-
export declare const FileVideo: ReturnType<typeof createLucideIcon>;
|
|
972
976
|
export declare const FileVideo2: ReturnType<typeof createLucideIcon>;
|
|
973
977
|
export declare const FileVideoCamera: ReturnType<typeof createLucideIcon>;
|
|
974
978
|
export declare const FileVolume: ReturnType<typeof createLucideIcon>;
|
|
@@ -1030,7 +1034,6 @@ export declare const FolderKey: ReturnType<typeof createLucideIcon>;
|
|
|
1030
1034
|
export declare const FolderLock: ReturnType<typeof createLucideIcon>;
|
|
1031
1035
|
export declare const FolderMinus: ReturnType<typeof createLucideIcon>;
|
|
1032
1036
|
export declare const FolderNetwork: ReturnType<typeof createLucideIcon>;
|
|
1033
|
-
export declare const FolderOpen: ReturnType<typeof createLucideIcon>;
|
|
1034
1037
|
export declare const FolderOpenDot: ReturnType<typeof createLucideIcon>;
|
|
1035
1038
|
export declare const FolderOutput: ReturnType<typeof createLucideIcon>;
|
|
1036
1039
|
export declare const FolderPen: ReturnType<typeof createLucideIcon>;
|
|
@@ -1106,7 +1109,6 @@ export declare const GitPullRequestCreateArrow: ReturnType<typeof createLucideIc
|
|
|
1106
1109
|
export declare const GitPullRequestDraft: ReturnType<typeof createLucideIcon>;
|
|
1107
1110
|
export declare const GlassWater: ReturnType<typeof createLucideIcon>;
|
|
1108
1111
|
export declare const Glasses: ReturnType<typeof createLucideIcon>;
|
|
1109
|
-
export declare const Globe: ReturnType<typeof createLucideIcon>;
|
|
1110
1112
|
export declare const Globe2: ReturnType<typeof createLucideIcon>;
|
|
1111
1113
|
export declare const GlobeBan: ReturnType<typeof createLucideIcon>;
|
|
1112
1114
|
export declare const GlobeCheck: ReturnType<typeof createLucideIcon>;
|
|
@@ -1589,7 +1591,6 @@ export declare const Option: ReturnType<typeof createLucideIcon>;
|
|
|
1589
1591
|
export declare const Orbit: ReturnType<typeof createLucideIcon>;
|
|
1590
1592
|
export declare const Origami: ReturnType<typeof createLucideIcon>;
|
|
1591
1593
|
export declare const Outdent: ReturnType<typeof createLucideIcon>;
|
|
1592
|
-
export declare const Package: ReturnType<typeof createLucideIcon>;
|
|
1593
1594
|
export declare const Package2: ReturnType<typeof createLucideIcon>;
|
|
1594
1595
|
export declare const PackageArrowBendUpLeft: ReturnType<typeof createLucideIcon>;
|
|
1595
1596
|
export declare const PackageCheck: ReturnType<typeof createLucideIcon>;
|
|
@@ -1725,7 +1726,6 @@ export declare const Power: ReturnType<typeof createLucideIcon>;
|
|
|
1725
1726
|
export declare const PowerCircle: ReturnType<typeof createLucideIcon>;
|
|
1726
1727
|
export declare const PowerOff: ReturnType<typeof createLucideIcon>;
|
|
1727
1728
|
export declare const PowerSquare: ReturnType<typeof createLucideIcon>;
|
|
1728
|
-
export declare const Presentation: ReturnType<typeof createLucideIcon>;
|
|
1729
1729
|
export declare const Printer: ReturnType<typeof createLucideIcon>;
|
|
1730
1730
|
export declare const Printer3D: ReturnType<typeof createLucideIcon>;
|
|
1731
1731
|
export declare const Printer3d: ReturnType<typeof createLucideIcon>;
|