foldkit 0.132.0 → 0.134.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.
- package/README.md +59 -108
- package/dist/canvas/view.d.ts +18 -11
- package/dist/canvas/view.d.ts.map +1 -1
- package/dist/canvas/view.js +18 -11
- package/dist/customElement/index.d.ts +9 -6
- package/dist/customElement/index.d.ts.map +1 -1
- package/dist/customElement/index.js +14 -3
- package/dist/devTools/protocol.d.ts +19 -1
- package/dist/devTools/protocol.d.ts.map +1 -1
- package/dist/devTools/protocol.js +13 -1
- package/dist/devTools/public.d.ts +1 -1
- package/dist/devTools/public.d.ts.map +1 -1
- package/dist/devTools/public.js +1 -1
- package/dist/devTools/store.d.ts +6 -0
- package/dist/devTools/store.d.ts.map +1 -1
- package/dist/devTools/store.js +7 -1
- package/dist/devTools/webSocketBridge.d.ts +7 -0
- package/dist/devTools/webSocketBridge.d.ts.map +1 -1
- package/dist/devTools/webSocketBridge.js +36 -8
- package/dist/html/boundary.d.ts.map +1 -1
- package/dist/html/boundary.js +48 -2
- package/dist/html/index.d.ts +682 -1643
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +56 -16
- package/dist/html/public.d.ts +2 -2
- package/dist/html/public.d.ts.map +1 -1
- package/dist/html/public.js +1 -1
- package/dist/html/runtimeSingleton.d.ts +1 -1
- package/dist/html/runtimeSingleton.d.ts.map +1 -1
- package/dist/html/runtimeSingleton.js +1 -1
- package/dist/html/submodel.d.ts +51 -19
- package/dist/html/submodel.d.ts.map +1 -1
- package/dist/html/submodel.js +37 -13
- package/dist/route/transition.d.ts +35 -29
- package/dist/route/transition.d.ts.map +1 -1
- package/dist/route/transition.js +36 -30
- package/dist/runtime/crashUI.d.ts.map +1 -1
- package/dist/runtime/crashUI.js +29 -30
- package/dist/runtime/runtime.d.ts +9 -6
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +25 -8
- package/dist/test/apps/attributes.d.ts +2 -2
- package/dist/test/apps/attributes.d.ts.map +1 -1
- package/dist/test/apps/attributes.js +1 -3
- package/dist/test/apps/bubbling.d.ts +2 -2
- package/dist/test/apps/bubbling.d.ts.map +1 -1
- package/dist/test/apps/bubbling.js +1 -3
- package/dist/test/apps/counter.d.ts +2 -2
- package/dist/test/apps/counter.d.ts.map +1 -1
- package/dist/test/apps/counter.js +1 -3
- package/dist/test/apps/crashOnRender.d.ts +2 -2
- package/dist/test/apps/crashOnRender.d.ts.map +1 -1
- package/dist/test/apps/crashOnRender.js +1 -3
- package/dist/test/apps/drafts.d.ts +2 -2
- package/dist/test/apps/drafts.d.ts.map +1 -1
- package/dist/test/apps/drafts.js +1 -3
- package/dist/test/apps/fileUpload.d.ts +2 -2
- package/dist/test/apps/fileUpload.d.ts.map +1 -1
- package/dist/test/apps/fileUpload.js +1 -3
- package/dist/test/apps/interactions.d.ts +2 -2
- package/dist/test/apps/interactions.d.ts.map +1 -1
- package/dist/test/apps/interactions.js +1 -3
- package/dist/test/apps/keypress.d.ts +2 -2
- package/dist/test/apps/keypress.d.ts.map +1 -1
- package/dist/test/apps/keypress.js +1 -3
- package/dist/test/apps/login.d.ts +2 -2
- package/dist/test/apps/login.d.ts.map +1 -1
- package/dist/test/apps/login.js +1 -3
- package/dist/test/apps/logoutButton.d.ts +2 -2
- package/dist/test/apps/logoutButton.d.ts.map +1 -1
- package/dist/test/apps/logoutButton.js +1 -3
- package/dist/test/apps/mountPanel.d.ts +4 -4
- package/dist/test/apps/mountPanel.d.ts.map +1 -1
- package/dist/test/apps/mountPanel.js +3 -7
- package/dist/test/apps/multiRole.d.ts +2 -2
- package/dist/test/apps/multiRole.d.ts.map +1 -1
- package/dist/test/apps/multiRole.js +1 -3
- package/dist/test/apps/pointer.d.ts +2 -2
- package/dist/test/apps/pointer.d.ts.map +1 -1
- package/dist/test/apps/pointer.js +1 -3
- package/dist/test/apps/resumeUpload.d.ts +2 -2
- package/dist/test/apps/resumeUpload.d.ts.map +1 -1
- package/dist/test/apps/resumeUpload.js +3 -6
- package/dist/test/apps/uploads.d.ts +2 -2
- package/dist/test/apps/uploads.d.ts.map +1 -1
- package/dist/test/apps/uploads.js +1 -3
- package/dist/test/scene.d.ts +3 -3
- package/dist/test/scene.d.ts.map +1 -1
- package/dist/test/scene.js +2 -2
- package/package.json +6 -6
package/dist/runtime/runtime.js
CHANGED
|
@@ -3,7 +3,7 @@ import { BrowserRuntime } from '@effect/platform-browser';
|
|
|
3
3
|
import { __CurrentRegistry as __CurrentInterruptRegistry, __makeRegistry as __makeInterruptRegistry, } from '../command/interruptible/index.js';
|
|
4
4
|
import { createDevToolsStore, } from '../devTools/store.js';
|
|
5
5
|
import { startWebSocketBridge } from '../devTools/webSocketBridge.js';
|
|
6
|
-
import { __beginRender as beginHtmlRender, __beginReplayRender as beginReplayHtmlRender, __clearRuntime as clearHtmlRuntime, __createBoundaryRegistry as createHtmlBoundaryRegistry, __endReplayRender as endReplayHtmlRender, __setRuntime as setHtmlRuntime, } from '../html/index.js';
|
|
6
|
+
import { __beginRender as beginHtmlRender, __beginReplayRender as beginReplayHtmlRender, __clearRuntime as clearHtmlRuntime, __createBoundaryRegistry as createHtmlBoundaryRegistry, __endReplayRender as endReplayHtmlRender, __htmlBuilder as htmlBuilderFor, __setRuntime as setHtmlRuntime, } from '../html/index.js';
|
|
7
7
|
import { MountTracker } from '../mount/index.js';
|
|
8
8
|
import { __CurrentPortChannels, __makeInboundChannel, } from '../port/index.js';
|
|
9
9
|
import { fromString as urlFromString } from '../url/index.js';
|
|
@@ -310,6 +310,7 @@ const validatePorts = (ports) => {
|
|
|
310
310
|
const runtimeInternals = new WeakMap();
|
|
311
311
|
const makeRuntime = ({ ports, Model, flags: resolveFlags, init, update, view, manageDocument, subscriptions, container, routing: routingConfig, crash, slow, freezeModel, preserveScroll, resources, managedResources, devTools, }) => {
|
|
312
312
|
const isSlowVisible = (show) => Match.value(show).pipe(Match.when('Always', () => true), Match.when('Development', () => !!import.meta.hot), Match.exhaustive);
|
|
313
|
+
const htmlBuilder = htmlBuilderFor();
|
|
313
314
|
const resolvedSlow = __resolveSlowConfig(slow, isSlowVisible);
|
|
314
315
|
const resolvedSlowView = Option.flatMap(resolvedSlow, ({ view }) => view);
|
|
315
316
|
const resolvedSlowUpdate = Option.flatMap(resolvedSlow, ({ update }) => update);
|
|
@@ -820,7 +821,7 @@ const makeRuntime = ({ ports, Model, flags: resolveFlags, init, update, view, ma
|
|
|
820
821
|
beginHtmlRender(boundaryRegistry);
|
|
821
822
|
setHtmlRuntime(dispatchService.dispatchSync, runtimeContext, boundaryRegistry);
|
|
822
823
|
try {
|
|
823
|
-
return view(model);
|
|
824
|
+
return view(model, htmlBuilder);
|
|
824
825
|
}
|
|
825
826
|
finally {
|
|
826
827
|
clearHtmlRuntime();
|
|
@@ -1001,7 +1002,7 @@ const makeRuntime = ({ ports, Model, flags: resolveFlags, init, update, view, ma
|
|
|
1001
1002
|
beginHtmlRender(boundaryRegistry);
|
|
1002
1003
|
setHtmlRuntime(dispatch.dispatchSync, liveRenderContext, boundaryRegistry);
|
|
1003
1004
|
try {
|
|
1004
|
-
return view(model);
|
|
1005
|
+
return view(model, htmlBuilder);
|
|
1005
1006
|
}
|
|
1006
1007
|
finally {
|
|
1007
1008
|
clearHtmlRuntime();
|
|
@@ -1185,6 +1186,11 @@ const currentLocationUrl = () => {
|
|
|
1185
1186
|
const { origin, pathname, search } = window.location;
|
|
1186
1187
|
return `${origin}${pathname}${search}`;
|
|
1187
1188
|
};
|
|
1189
|
+
const textDirectionForHtmlElement = {
|
|
1190
|
+
Ltr: 'ltr',
|
|
1191
|
+
Rtl: 'rtl',
|
|
1192
|
+
Auto: 'auto',
|
|
1193
|
+
};
|
|
1188
1194
|
const documentMetadataElements = new WeakMap();
|
|
1189
1195
|
const metadataElementsForDocument = () => {
|
|
1190
1196
|
let elements = documentMetadataElements.get(document);
|
|
@@ -1215,6 +1221,17 @@ const applyDocumentMetadata = (nextDocument, mountedRoot) => {
|
|
|
1215
1221
|
if (document.title !== nextDocument.title) {
|
|
1216
1222
|
document.title = nextDocument.title;
|
|
1217
1223
|
}
|
|
1224
|
+
const { documentElement } = document;
|
|
1225
|
+
if (nextDocument.lang !== undefined &&
|
|
1226
|
+
documentElement.lang !== nextDocument.lang) {
|
|
1227
|
+
documentElement.lang = nextDocument.lang;
|
|
1228
|
+
}
|
|
1229
|
+
if (nextDocument.dir !== undefined) {
|
|
1230
|
+
const dir = textDirectionForHtmlElement[nextDocument.dir];
|
|
1231
|
+
if (documentElement.dir !== dir) {
|
|
1232
|
+
documentElement.dir = dir;
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1218
1235
|
const canonical = nextDocument.canonical ?? currentLocationUrl();
|
|
1219
1236
|
const ogUrl = nextDocument.ogUrl ?? canonical;
|
|
1220
1237
|
const metadataElements = metadataElementsForDocument();
|
|
@@ -1250,7 +1267,7 @@ const renderCrashView = (context, crash, container, vnodeSlot, manageDocument) =
|
|
|
1250
1267
|
let crashDocument;
|
|
1251
1268
|
try {
|
|
1252
1269
|
crashDocument = crash?.view
|
|
1253
|
-
? crash.view(context)
|
|
1270
|
+
? crash.view(context, htmlBuilderFor())
|
|
1254
1271
|
: defaultCrashView(context);
|
|
1255
1272
|
}
|
|
1256
1273
|
finally {
|
|
@@ -1361,9 +1378,9 @@ const toCrashConfig = (crash) => {
|
|
|
1361
1378
|
const elementCrashView = crash.view;
|
|
1362
1379
|
return {
|
|
1363
1380
|
...(Predicate.isNotUndefined(elementCrashView) && {
|
|
1364
|
-
view: (context) => ({
|
|
1381
|
+
view: (context, h) => ({
|
|
1365
1382
|
title: '',
|
|
1366
|
-
body: elementCrashView(context),
|
|
1383
|
+
body: elementCrashView(context, h),
|
|
1367
1384
|
}),
|
|
1368
1385
|
}),
|
|
1369
1386
|
...(Predicate.isNotUndefined(crash.report) && {
|
|
@@ -1380,9 +1397,9 @@ export function makeElement(config) {
|
|
|
1380
1397
|
}
|
|
1381
1398
|
const hasFlags = 'Flags' in config;
|
|
1382
1399
|
const elementView = config.view;
|
|
1383
|
-
const view = (model) => ({
|
|
1400
|
+
const view = (model, h) => ({
|
|
1384
1401
|
title: '',
|
|
1385
|
-
body: elementView(model),
|
|
1402
|
+
body: elementView(model, h),
|
|
1386
1403
|
});
|
|
1387
1404
|
const crash = toCrashConfig(config.crash);
|
|
1388
1405
|
const baseConfig = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as S } from 'effect';
|
|
2
|
-
import type { Attribute, Html } from '../../html/index.js';
|
|
2
|
+
import type { Attribute, Html, HtmlBuilder } from '../../html/index.js';
|
|
3
3
|
export declare const IgnoredInteraction: import("../../schema/index.js").CallableTaggedStruct<"IgnoredInteraction", {}>;
|
|
4
4
|
export declare const Message: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"IgnoredInteraction", {}>]>;
|
|
5
5
|
export type Message = typeof Message.Type;
|
|
@@ -8,5 +8,5 @@ export type Model = Readonly<{
|
|
|
8
8
|
}>;
|
|
9
9
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<never>];
|
|
10
10
|
export declare const testId = "attribute-host";
|
|
11
|
-
export declare const view: (model: Model) => Html;
|
|
11
|
+
export declare const view: (model: Model, h: HtmlBuilder<Message>) => Html;
|
|
12
12
|
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/test/apps/attributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/test/apps/attributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAKvE,eAAO,MAAM,kBAAkB,gFAA0B,CAAA;AAEzD,eAAO,MAAM,OAAO,oGAAgC,CAAA;AACpD,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC;IAAE,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;CAAE,CAAC,CAAA;AAI/D,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAMrC,CAAA;AAMH,eAAO,MAAM,MAAM,mBAAU,CAAA;AAE7B,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,IAE5D,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Match as M, Schema as S } from 'effect';
|
|
2
|
-
import { html } from '../../html/index.js';
|
|
3
2
|
import { m } from '../../message/index.js';
|
|
4
3
|
// MESSAGE
|
|
5
4
|
export const IgnoredInteraction = m('IgnoredInteraction');
|
|
@@ -11,7 +10,6 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
11
10
|
// VIEW
|
|
12
11
|
const TEST_ID = 'attribute-host';
|
|
13
12
|
export const testId = TEST_ID;
|
|
14
|
-
export const view = (model) => {
|
|
15
|
-
const h = html();
|
|
13
|
+
export const view = (model, h) => {
|
|
16
14
|
return h.div([h.DataAttribute('testid', TEST_ID), model.attribute], []);
|
|
17
15
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as S } from 'effect';
|
|
2
|
-
import {
|
|
2
|
+
import type { Html, HtmlBuilder } from '../../html/index.js';
|
|
3
3
|
export declare const Model: S.Struct<{
|
|
4
4
|
readonly clicks: S.Number;
|
|
5
5
|
readonly doubleClicks: S.Number;
|
|
@@ -9,6 +9,6 @@ declare const Message: S.Union<readonly [import("../../schema/index.js").Callabl
|
|
|
9
9
|
type Message = typeof Message.Type;
|
|
10
10
|
export declare const initialModel: Model;
|
|
11
11
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<never>];
|
|
12
|
-
export declare const view: (model: Model) => Html;
|
|
12
|
+
export declare const view: (model: Model, h: HtmlBuilder<Message>) => Html;
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=bubbling.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bubbling.d.ts","sourceRoot":"","sources":["../../../src/test/apps/bubbling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"bubbling.d.ts","sourceRoot":"","sources":["../../../src/test/apps/bubbling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAK5D,eAAO,MAAM,KAAK;;;EAGhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAOrC,QAAA,MAAM,OAAO,sLAAsD,CAAA;AACnE,KAAK,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIlC,eAAO,MAAM,YAAY,EAAE,KAG1B,CAAA;AAID,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAUrC,CAAA;AAIH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,IAc5D,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Match as M, Schema as S } from 'effect';
|
|
2
|
-
import { html } from '../../html/index.js';
|
|
3
2
|
import { m } from '../../message/index.js';
|
|
4
3
|
// MODEL
|
|
5
4
|
export const Model = S.Struct({
|
|
@@ -24,8 +23,7 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
24
23
|
],
|
|
25
24
|
}));
|
|
26
25
|
// VIEW
|
|
27
|
-
export const view = (model) => {
|
|
28
|
-
const h = html();
|
|
26
|
+
export const view = (model, h) => {
|
|
29
27
|
return h.div([], [
|
|
30
28
|
h.div([h.Role('option'), h.OnClick(ClickedContainer())], [h.span([], [`clicks=${model.clicks}`])]),
|
|
31
29
|
h.div([h.Role('listitem'), h.OnDoubleClick(DoubleClickedContainer())], [h.span([], [`dbl=${model.doubleClicks}`])]),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Schema as S } from 'effect';
|
|
2
2
|
import * as Command from '../../command/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { Html, HtmlBuilder } from '../../html/index.js';
|
|
4
4
|
export declare const Model: S.Struct<{
|
|
5
5
|
readonly count: S.Number;
|
|
6
6
|
readonly log: S.$Array<S.Number>;
|
|
@@ -41,5 +41,5 @@ export declare const FetchCountById: Command.CommandDefinitionWithArgs<"FetchCou
|
|
|
41
41
|
}, never, never>>;
|
|
42
42
|
export declare const initialModel: Model;
|
|
43
43
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
44
|
-
export declare const view: (model: Model) => Html;
|
|
44
|
+
export declare const view: (model: Model, h: HtmlBuilder<Message>) => Html;
|
|
45
45
|
//# sourceMappingURL=counter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../../src/test/apps/counter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../../src/test/apps/counter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAK5D,eAAO,MAAM,KAAK;;;EAGhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,gBAAgB,8EAAwB,CAAA;AACrD,eAAO,MAAM,gBAAgB,8EAAwB,CAAA;AACrD,eAAO,MAAM,YAAY,0EAAoB,CAAA;AAC7C,eAAO,MAAM,gBAAgB;;EAA0C,CAAA;AACvE,eAAO,MAAM,mBAAmB,iFAA2B,CAAA;AAC3D,eAAO,MAAM,qBAAqB,mFAA6B,CAAA;AAC/D,eAAO,MAAM,mBAAmB,iFAA2B,CAAA;AAC3D,eAAO,MAAM,mBAAmB;;EAAgD,CAAA;AAChF,eAAO,MAAM,gBAAgB;;EAA6C,CAAA;AAE1E,eAAO,MAAM,OAAO;;;;;;IAUlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,UAAU;;;iBAIgC,CAAA;AAEvD,eAAO,MAAM,cAAc;;;;;iBAKyC,CAAA;AAIpE,eAAO,MAAM,YAAY,EAAE,KAA6B,CAAA;AAIxD,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAiCxD,CAAA;AAIH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,IAe5D,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Effect, Match as M, Schema as S } from 'effect';
|
|
2
2
|
import * as Command from '../../command/index.js';
|
|
3
|
-
import { html } from '../../html/index.js';
|
|
4
3
|
import { m } from '../../message/index.js';
|
|
5
4
|
// MODEL
|
|
6
5
|
export const Model = S.Struct({
|
|
@@ -63,8 +62,7 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
63
62
|
FailedFetchCount: () => [model, []],
|
|
64
63
|
}));
|
|
65
64
|
// VIEW
|
|
66
|
-
export const view = (model) => {
|
|
67
|
-
const h = html();
|
|
65
|
+
export const view = (model, h) => {
|
|
68
66
|
return h.div([], [
|
|
69
67
|
h.span([h.Role('status')], [`count: ${model.count}`]),
|
|
70
68
|
h.button([h.OnClick(StartedThreeFetches()), h.Role('button')], ['Start three fetches']),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Schema as S } from 'effect';
|
|
2
2
|
import * as Command from '../../command/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { Document, HtmlBuilder } from '../../html/index.js';
|
|
4
4
|
export declare const RawSource: S.Struct<{
|
|
5
5
|
readonly kind: S.Literal<"Book">;
|
|
6
6
|
readonly id: S.String;
|
|
@@ -60,5 +60,5 @@ export declare const validSources: ReadonlyArray<RawSource>;
|
|
|
60
60
|
export declare const malformedSources: ReadonlyArray<RawSource>;
|
|
61
61
|
export declare const initialModel: Model;
|
|
62
62
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
63
|
-
export declare const view: (model: Model) => Document;
|
|
63
|
+
export declare const view: (model: Model, h: HtmlBuilder<Message>) => Document;
|
|
64
64
|
//# sourceMappingURL=crashOnRender.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crashOnRender.d.ts","sourceRoot":"","sources":["../../../src/test/apps/crashOnRender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE/D,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"crashOnRender.d.ts","sourceRoot":"","sources":["../../../src/test/apps/crashOnRender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE/D,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAMhE,eAAO,MAAM,SAAS;;;EAGpB,CAAA;AACF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAK7C,eAAO,MAAM,MAAM;;;EAGjB,CAAA;AACF,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AAEvC,eAAO,MAAM,KAAK;;;;;EAEhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,aAAa;;;;;EAAsD,CAAA;AAChF,eAAO,MAAM,cAAc;;;;;EAA0C,CAAA;AACrE,eAAO,MAAM,oBAAoB;;EAA8C,CAAA;AAE/E,eAAO,MAAM,OAAO;;;;;;;;;;;;IAKlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAMzC,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC,SAAS,CAGpD,CAAA;AAED,eAAO,MAAM,aAAa;;;;;;iBAGoC,CAAA;AAI9D,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,SAAS,CAEjD,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC,SAAS,CAErD,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAAiC,CAAA;AAI5D,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAiBxD,CAAA;AAIH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,QA4B5D,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Array, Effect, Match as M, Schema as S } from 'effect';
|
|
2
2
|
import * as Command from '../../command/index.js';
|
|
3
|
-
import { html } from '../../html/index.js';
|
|
4
3
|
import { m } from '../../message/index.js';
|
|
5
4
|
import { evo } from '../../struct/index.js';
|
|
6
5
|
// MODEL
|
|
@@ -59,8 +58,7 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
59
58
|
},
|
|
60
59
|
}));
|
|
61
60
|
// VIEW
|
|
62
|
-
export const view = (model) => {
|
|
63
|
-
const h = html();
|
|
61
|
+
export const view = (model, h) => {
|
|
64
62
|
const body = h.div([], [
|
|
65
63
|
h.button([h.OnClick(ClickedReload()), h.Role('button')], ['Reload']),
|
|
66
64
|
h.button([h.OnClick(SubmittedNewSourceId({ id: '' })), h.Role('button')], ['Add source']),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Schema as S } from 'effect';
|
|
2
2
|
import * as Command from '../../command/index.js';
|
|
3
3
|
import * as Interruptible from '../../command/interruptible/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import type { Document, HtmlBuilder } from '../../html/index.js';
|
|
5
5
|
export declare const SaveStatus: S.Literals<readonly ["Editing", "Saving", "Saved"]>;
|
|
6
6
|
export type SaveStatus = typeof SaveStatus.Type;
|
|
7
7
|
export declare const Model: S.Struct<{
|
|
@@ -29,5 +29,5 @@ export declare const SaveDraft: Interruptible.DefinitionWithArgsNameKeyed<"SaveD
|
|
|
29
29
|
}, never, never>>;
|
|
30
30
|
export declare const initialModel: Model;
|
|
31
31
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
32
|
-
export declare const view: (model: Model) => Document;
|
|
32
|
+
export declare const view: (model: Model, h: HtmlBuilder<Message>) => Document;
|
|
33
33
|
//# sourceMappingURL=drafts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drafts.d.ts","sourceRoot":"","sources":["../../../src/test/apps/drafts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,aAAa,MAAM,sCAAsC,CAAA;AACrE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"drafts.d.ts","sourceRoot":"","sources":["../../../src/test/apps/drafts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,aAAa,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAMhE,eAAO,MAAM,UAAU,qDAA6C,CAAA;AACpE,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAE/C,eAAO,MAAM,KAAK;;;EAGhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,gBAAgB,8EAAwB,CAAA;AACrD,eAAO,MAAM,kBAAkB;;EAE7B,CAAA;AAEF,eAAO,MAAM,OAAO;;IAAkD,CAAA;AACtE,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,aAAa;;EAAmC,CAAA;AAC7D,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAA;AAErD,eAAO,MAAM,SAAS;;;;;iBAIwD,CAAA;AAI9E,eAAO,MAAM,YAAY,EAAE,KAA0C,CAAA;AAIrE,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAYxD,CAAA;AAIH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,QAU5D,CAAA"}
|
package/dist/test/apps/drafts.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Effect, Match as M, Schema as S } from 'effect';
|
|
2
2
|
import * as Interruptible from '../../command/interruptible/index.js';
|
|
3
|
-
import { html } from '../../html/index.js';
|
|
4
3
|
import { m } from '../../message/index.js';
|
|
5
4
|
import { evo } from '../../struct/index.js';
|
|
6
5
|
// MODEL
|
|
@@ -29,8 +28,7 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
29
28
|
SucceededSaveDraft: () => [evo(model, { status: () => 'Saved' }), []],
|
|
30
29
|
}));
|
|
31
30
|
// VIEW
|
|
32
|
-
export const view = (model) => {
|
|
33
|
-
const h = html();
|
|
31
|
+
export const view = (model, h) => {
|
|
34
32
|
const body = h.div([], [
|
|
35
33
|
h.button([h.OnClick(ClickedSaveDraft())], ['Save draft']),
|
|
36
34
|
h.span([], [`draft: ${model.status}`]),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema as S } from 'effect';
|
|
2
2
|
import { File } from '../../file/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { Html, HtmlBuilder } from '../../html/index.js';
|
|
4
4
|
export type Model = Readonly<{
|
|
5
5
|
receivedFiles: ReadonlyArray<File>;
|
|
6
6
|
}>;
|
|
@@ -13,5 +13,5 @@ export declare const Message: S.Union<readonly [import("../../schema/index.js").
|
|
|
13
13
|
}>]>;
|
|
14
14
|
export type Message = typeof Message.Type;
|
|
15
15
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<never>];
|
|
16
|
-
export declare const view: (model: Model) => Html;
|
|
16
|
+
export declare const view: (model: Model, h: HtmlBuilder<Message>) => Html;
|
|
17
17
|
//# sourceMappingURL=fileUpload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileUpload.d.ts","sourceRoot":"","sources":["../../../src/test/apps/fileUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"fileUpload.d.ts","sourceRoot":"","sources":["../../../src/test/apps/fileUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAK5D,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;CACnC,CAAC,CAAA;AAEF,eAAO,MAAM,YAAY,EAAE,KAA6B,CAAA;AAIxD,eAAO,MAAM,aAAa;;EAA+C,CAAA;AAEzE,eAAO,MAAM,OAAO;;IAA2B,CAAA;AAC/C,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAMrC,CAAA;AAIH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,IA4B5D,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Match as M, Schema as S } from 'effect';
|
|
2
2
|
import { File } from '../../file/index.js';
|
|
3
|
-
import { html } from '../../html/index.js';
|
|
4
3
|
import { m } from '../../message/index.js';
|
|
5
4
|
export const initialModel = { receivedFiles: [] };
|
|
6
5
|
// MESSAGE
|
|
@@ -11,8 +10,7 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
11
10
|
ReceivedFiles: ({ files }) => [{ ...model, receivedFiles: files }, []],
|
|
12
11
|
}));
|
|
13
12
|
// VIEW
|
|
14
|
-
export const view = (model) => {
|
|
15
|
-
const h = html();
|
|
13
|
+
export const view = (model, h) => {
|
|
16
14
|
return h.div([], [
|
|
17
15
|
h.input([
|
|
18
16
|
h.Key('file-input'),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as S } from 'effect';
|
|
2
|
-
import {
|
|
2
|
+
import type { Html, HtmlBuilder } from '../../html/index.js';
|
|
3
3
|
export declare const Model: S.Struct<{
|
|
4
4
|
readonly clicks: S.Number;
|
|
5
5
|
readonly doubleClicks: S.Number;
|
|
@@ -22,5 +22,5 @@ export declare const Message: S.Union<readonly [import("../../schema/index.js").
|
|
|
22
22
|
export type Message = typeof Message.Type;
|
|
23
23
|
export declare const initialModel: Model;
|
|
24
24
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<never>];
|
|
25
|
-
export declare const view: (model: Model) => Html;
|
|
25
|
+
export declare const view: (model: Model, h: HtmlBuilder<Message>) => Html;
|
|
26
26
|
//# sourceMappingURL=interactions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactions.d.ts","sourceRoot":"","sources":["../../../src/test/apps/interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"interactions.d.ts","sourceRoot":"","sources":["../../../src/test/apps/interactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAK5D,eAAO,MAAM,KAAK;;;;;;EAMhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,mBAAmB,iFAA2B,CAAA;AAC3D,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,YAAY,0EAAoB,CAAA;AAC7C,eAAO,MAAM,YAAY,0EAAoB,CAAA;AAC7C,eAAO,MAAM,aAAa;;EAA0C,CAAA;AAEpE,eAAO,MAAM,OAAO;;IAOlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,YAAY,EAAE,KAM1B,CAAA;AAID,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAcrC,CAAA;AAIH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,IA4B5D,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Match as M, Schema as S } from 'effect';
|
|
2
|
-
import { html } from '../../html/index.js';
|
|
3
2
|
import { m } from '../../message/index.js';
|
|
4
3
|
// MODEL
|
|
5
4
|
export const Model = S.Struct({
|
|
@@ -45,8 +44,7 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
45
44
|
ChangedSelect: ({ value }) => [{ ...model, changed: value }, []],
|
|
46
45
|
}));
|
|
47
46
|
// VIEW
|
|
48
|
-
export const view = (model) => {
|
|
49
|
-
const h = html();
|
|
47
|
+
export const view = (model, h) => {
|
|
50
48
|
return h.div([], [
|
|
51
49
|
h.button([
|
|
52
50
|
h.OnClick(ClickedButton()),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as S } from 'effect';
|
|
2
|
-
import type { Html } from '../../html/index.js';
|
|
2
|
+
import type { Html, HtmlBuilder } from '../../html/index.js';
|
|
3
3
|
export declare const Model: S.Struct<{
|
|
4
4
|
readonly lastKey: S.String;
|
|
5
5
|
readonly isShifted: S.Boolean;
|
|
@@ -19,5 +19,5 @@ export declare const Message: S.Union<readonly [import("../../schema/index.js").
|
|
|
19
19
|
export type Message = typeof Message.Type;
|
|
20
20
|
export declare const initialModel: Model;
|
|
21
21
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<never>];
|
|
22
|
-
export declare const view: (model: Model) => Html;
|
|
22
|
+
export declare const view: (model: Model, h: HtmlBuilder<Message>) => Html;
|
|
23
23
|
//# sourceMappingURL=keypress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keypress.d.ts","sourceRoot":"","sources":["../../../src/test/apps/keypress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"keypress.d.ts","sourceRoot":"","sources":["../../../src/test/apps/keypress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAK5D,eAAO,MAAM,KAAK;;;EAGhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,UAAU;;EAAqC,CAAA;AAC5D,eAAO,MAAM,eAAe;;EAA0C,CAAA;AAEtE,eAAO,MAAM,OAAO;;;;IAAyC,CAAA;AAC7D,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,YAAY,EAAE,KAG1B,CAAA;AAID,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAarC,CAAA;AAIH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,IAkB5D,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Match as M, Schema as S } from 'effect';
|
|
2
|
-
import { html } from '../../html/index.js';
|
|
3
2
|
import { m } from '../../message/index.js';
|
|
4
3
|
// MODEL
|
|
5
4
|
export const Model = S.Struct({
|
|
@@ -27,8 +26,7 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
27
26
|
],
|
|
28
27
|
}));
|
|
29
28
|
// VIEW
|
|
30
|
-
export const view = (model) => {
|
|
31
|
-
const h = html();
|
|
29
|
+
export const view = (model, h) => {
|
|
32
30
|
return h.div([
|
|
33
31
|
h.Id('key-app'),
|
|
34
32
|
h.Role('application'),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Schema as S } from 'effect';
|
|
2
2
|
import * as Command from '../../command/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { Html, HtmlBuilder } from '../../html/index.js';
|
|
4
4
|
export declare const Model: S.Struct<{
|
|
5
5
|
readonly email: S.String;
|
|
6
6
|
readonly password: S.String;
|
|
@@ -39,5 +39,5 @@ export declare const Authenticate: Command.CommandDefinitionNoArgs<"Authenticate
|
|
|
39
39
|
}, never, never>>;
|
|
40
40
|
export declare const initialModel: Model;
|
|
41
41
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
42
|
-
export declare const view: (model: Model) => Html;
|
|
42
|
+
export declare const view: (model: Model, h: HtmlBuilder<Message>) => Html;
|
|
43
43
|
//# sourceMappingURL=login.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/test/apps/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/test/apps/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAK5D,eAAO,MAAM,KAAK;;;;;;EAMhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,YAAY;;EAAyC,CAAA;AAClE,eAAO,MAAM,eAAe;;EAA4C,CAAA;AACxE,eAAO,MAAM,cAAc,4EAAsB,CAAA;AACjD,eAAO,MAAM,qBAAqB;;EAEhC,CAAA;AACF,eAAO,MAAM,kBAAkB;;EAA+C,CAAA;AAC9E,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAE/C,eAAO,MAAM,OAAO;;;;;;;;+EAOlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,YAAY;;;iBAIyC,CAAA;AAIlE,eAAO,MAAM,YAAY,EAAE,KAM1B,CAAA;AAID,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAyBxD,CAAA;AAIH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,IA8E5D,CAAA"}
|
package/dist/test/apps/login.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Effect, Match as M, Schema as S } from 'effect';
|
|
2
2
|
import * as Command from '../../command/index.js';
|
|
3
|
-
import { html } from '../../html/index.js';
|
|
4
3
|
import { m } from '../../message/index.js';
|
|
5
4
|
// MODEL
|
|
6
5
|
export const Model = S.Struct({
|
|
@@ -59,8 +58,7 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
59
58
|
],
|
|
60
59
|
}));
|
|
61
60
|
// VIEW
|
|
62
|
-
export const view = (model) => {
|
|
63
|
-
const h = html();
|
|
61
|
+
export const view = (model, h) => {
|
|
64
62
|
return h.div([h.Id('app')], [
|
|
65
63
|
M.value(model.status).pipe(M.withReturnType(), M.when('Submitting', () => h.form([h.Class('login-form'), h.Disabled(true)], [h.button([h.Type('submit'), h.Disabled(true)], ['Signing in...'])])), M.when('LoggedIn', () => h.div([
|
|
66
64
|
h.Class('logged-in'),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Option, Schema as S } from 'effect';
|
|
2
|
-
import type { Html } from '../../html/index.js';
|
|
2
|
+
import type { Html, HtmlBuilder } from '../../html/index.js';
|
|
3
3
|
export declare const Model: S.Struct<{
|
|
4
4
|
readonly label: S.String;
|
|
5
5
|
}>;
|
|
@@ -13,5 +13,5 @@ export declare const OutMessage: S.Union<readonly [import("../../schema/index.js
|
|
|
13
13
|
export type OutMessage = typeof OutMessage.Type;
|
|
14
14
|
export declare const initialModel: Model;
|
|
15
15
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<never>, Option.Option<OutMessage>];
|
|
16
|
-
export declare const view: (model: Model) => Html;
|
|
16
|
+
export declare const view: (model: Model, h: HtmlBuilder<Message>) => Html;
|
|
17
17
|
//# sourceMappingURL=logoutButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logoutButton.d.ts","sourceRoot":"","sources":["../../../src/test/apps/logoutButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"logoutButton.d.ts","sourceRoot":"","sources":["../../../src/test/apps/logoutButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAK5D,eAAO,MAAM,KAAK;;EAAgC,CAAA;AAClD,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,eAAe,6EAAuB,CAAA;AAEnD,eAAO,MAAM,OAAO,4KAA4C,CAAA;AAChE,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,eAAe,6EAAuB,CAAA;AAEnD,eAAO,MAAM,UAAU,iGAA6B,CAAA;AACpD,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAI/C,eAAO,MAAM,YAAY,EAAE,KAA4B,CAAA;AAIvD,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAShE,CAAA;AAIH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,IAK5D,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Match as M, Option, Schema as S } from 'effect';
|
|
2
|
-
import { html } from '../../html/index.js';
|
|
3
2
|
import { m } from '../../message/index.js';
|
|
4
3
|
// MODEL
|
|
5
4
|
export const Model = S.Struct({ label: S.String });
|
|
@@ -18,7 +17,6 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
18
17
|
CompletedAction: () => [model, [], Option.none()],
|
|
19
18
|
}));
|
|
20
19
|
// VIEW
|
|
21
|
-
export const view = (model) => {
|
|
22
|
-
const h = html();
|
|
20
|
+
export const view = (model, h) => {
|
|
23
21
|
return h.div([], [h.button([h.OnClick(ClickedLogout()), h.Role('button')], [model.label])]);
|
|
24
22
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as S } from 'effect';
|
|
2
|
-
import type { Html } from '../../html/index.js';
|
|
2
|
+
import type { Html, HtmlBuilder } from '../../html/index.js';
|
|
3
3
|
import * as Mount from '../../mount/index.js';
|
|
4
4
|
export declare const Model: S.Struct<{
|
|
5
5
|
readonly isOpen: S.Boolean;
|
|
@@ -45,14 +45,14 @@ export declare const ScrollList: Mount.MountDefinitionWithArgs<"ScrollList", {
|
|
|
45
45
|
}>;
|
|
46
46
|
export declare const initialModel: Model;
|
|
47
47
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<never>];
|
|
48
|
-
export declare const view: (model: Model) => Html;
|
|
48
|
+
export declare const view: (model: Model, h: HtmlBuilder<Message>) => Html;
|
|
49
49
|
/** A view that always renders both the toggle button and the panel, exposing
|
|
50
50
|
* two MeasurePanel mounts simultaneously so we can exercise the (name,
|
|
51
51
|
* occurrence) tracking. */
|
|
52
|
-
export declare const twoPanelView: (model: Model) => Html;
|
|
52
|
+
export declare const twoPanelView: (model: Model, h: HtmlBuilder<Message>) => Html;
|
|
53
53
|
/** A view that renders an arg-bearing Mount so Scene tests can exercise
|
|
54
54
|
* Instance-based mount matching (matcher's args structurally equal the
|
|
55
55
|
* pending Mount's args). The chosen `offset` flows through `ScrollList`'s
|
|
56
56
|
* args and is observable on the rendered Mount marker. */
|
|
57
|
-
export declare const scrollListView: (offset: number) => Html;
|
|
57
|
+
export declare const scrollListView: (offset: number, h: HtmlBuilder<Message>) => Html;
|
|
58
58
|
//# sourceMappingURL=mountPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mountPanel.d.ts","sourceRoot":"","sources":["../../../src/test/apps/mountPanel.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"mountPanel.d.ts","sourceRoot":"","sources":["../../../src/test/apps/mountPanel.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhE,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAE5D,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAA;AAI7C,eAAO,MAAM,KAAK;;;;EAIhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,aAAa,2EAAqB,CAAA;AAC/C,eAAO,MAAM,aAAa;;EAA0C,CAAA;AACpE,eAAO,MAAM,oBAAoB,kFAA4B,CAAA;AAC7D,eAAO,MAAM,kBAAkB;;EAAgD,CAAA;AAC/E,eAAO,MAAM,gBAAgB,8EAAwB,CAAA;AACrD,eAAO,MAAM,UAAU;;EAAwC,CAAA;AAE/D,eAAO,MAAM,OAAO;;;;;;IAOlB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAWzC,eAAO,MAAM,YAAY;;;;;;EAI6B,CAAA;AAEtD,eAAO,MAAM,WAAW;;EAGuB,CAAA;AAE/C,eAAO,MAAM,UAAU;;;;;EAatB,CAAA;AAID,eAAO,MAAM,YAAY,EAAE,KAI1B,CAAA;AAID,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAcrC,CAAA;AAIH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,IA4B5D,CAAA;AAED;;4BAE4B;AAC5B,eAAO,MAAM,YAAY,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,IAYpE,CAAA;AAED;;;2DAG2D;AAC3D,eAAO,MAAM,cAAc,GACzB,QAAQ,MAAM,EACd,GAAG,WAAW,CAAC,OAAO,CAAC,KACtB,IAKF,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Effect, Match as M, Option, Schema as S } from 'effect';
|
|
2
|
-
import { html } from '../../html/index.js';
|
|
3
2
|
import { m } from '../../message/index.js';
|
|
4
3
|
import * as Mount from '../../mount/index.js';
|
|
5
4
|
// MODEL
|
|
@@ -57,8 +56,7 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
57
56
|
ScrolledTo: () => [model, []],
|
|
58
57
|
}));
|
|
59
58
|
// VIEW
|
|
60
|
-
export const view = (model) => {
|
|
61
|
-
const h = html();
|
|
59
|
+
export const view = (model, h) => {
|
|
62
60
|
return h.div([h.Class('panel-test')], [
|
|
63
61
|
h.button([h.Key('toggle'), h.OnClick(ClickedToggle()), h.OnMount(FocusButton())], [model.isOpen ? 'Close' : 'Open']),
|
|
64
62
|
...(model.isOpen
|
|
@@ -78,8 +76,7 @@ export const view = (model) => {
|
|
|
78
76
|
/** A view that always renders both the toggle button and the panel, exposing
|
|
79
77
|
* two MeasurePanel mounts simultaneously so we can exercise the (name,
|
|
80
78
|
* occurrence) tracking. */
|
|
81
|
-
export const twoPanelView = (model) => {
|
|
82
|
-
const h = html();
|
|
79
|
+
export const twoPanelView = (model, h) => {
|
|
83
80
|
return h.div([h.Class('two-panels')], [
|
|
84
81
|
h.div([h.Key('panel-a'), h.OnMount(MeasurePanel())], [h.span([], ['A'])]),
|
|
85
82
|
h.div([h.Key('panel-b'), h.OnMount(MeasurePanel())], [h.span([], ['B'])]),
|
|
@@ -90,7 +87,6 @@ export const twoPanelView = (model) => {
|
|
|
90
87
|
* Instance-based mount matching (matcher's args structurally equal the
|
|
91
88
|
* pending Mount's args). The chosen `offset` flows through `ScrollList`'s
|
|
92
89
|
* args and is observable on the rendered Mount marker. */
|
|
93
|
-
export const scrollListView = (offset) => {
|
|
94
|
-
const h = html();
|
|
90
|
+
export const scrollListView = (offset, h) => {
|
|
95
91
|
return h.div([h.Class('scroll-list')], [h.div([h.Key('list'), h.OnMount(ScrollList({ offset }))], [])]);
|
|
96
92
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as S } from 'effect';
|
|
2
|
-
import {
|
|
2
|
+
import type { Html, HtmlBuilder } from '../../html/index.js';
|
|
3
3
|
export declare const Model: S.Struct<{
|
|
4
4
|
readonly clicks: S.Number;
|
|
5
5
|
}>;
|
|
@@ -9,5 +9,5 @@ export declare const Message: S.Union<readonly [import("../../schema/index.js").
|
|
|
9
9
|
export type Message = typeof Message.Type;
|
|
10
10
|
export declare const initialModel: Model;
|
|
11
11
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<never>];
|
|
12
|
-
export declare const view: (model: Model) => Html;
|
|
12
|
+
export declare const view: (model: Model, h: HtmlBuilder<Message>) => Html;
|
|
13
13
|
//# sourceMappingURL=multiRole.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiRole.d.ts","sourceRoot":"","sources":["../../../src/test/apps/multiRole.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"multiRole.d.ts","sourceRoot":"","sources":["../../../src/test/apps/multiRole.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAK5D,eAAO,MAAM,KAAK;;EAAiC,CAAA;AACnD,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,eAAe,6EAAuB,CAAA;AAEnD,eAAO,MAAM,OAAO,iGAA6B,CAAA;AACjD,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,YAAY,EAAE,KAAqB,CAAA;AAIhD,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,SAAS,OAAO,KACf,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAMrC,CAAA;AAIH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAG,IAU5D,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Match as M, Schema as S } from 'effect';
|
|
2
|
-
import { html } from '../../html/index.js';
|
|
3
2
|
import { m } from '../../message/index.js';
|
|
4
3
|
// MODEL
|
|
5
4
|
export const Model = S.Struct({ clicks: S.Number });
|
|
@@ -13,8 +12,7 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
13
12
|
ClickedFallback: () => [{ ...model, clicks: model.clicks + 1 }, []],
|
|
14
13
|
}));
|
|
15
14
|
// VIEW
|
|
16
|
-
export const view = (model) => {
|
|
17
|
-
const h = html();
|
|
15
|
+
export const view = (model, h) => {
|
|
18
16
|
return h.div([], [
|
|
19
17
|
h.div([h.Role('doc-subtitle heading'), h.OnClick(ClickedFallback())], [`Fallback element clicks=${model.clicks}`]),
|
|
20
18
|
]);
|