@elaraai/e3-ui 1.0.83 → 1.0.85
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/dist/src/bind/data.d.ts +4 -3
- package/dist/src/bind/data.d.ts.map +1 -1
- package/dist/src/bind/data.js +4 -3
- package/dist/src/bind/data.js.map +1 -1
- package/dist/src/bind/record.d.ts +234 -6
- package/dist/src/bind/record.d.ts.map +1 -1
- package/dist/src/bind/record.js +250 -7
- package/dist/src/bind/record.js.map +1 -1
- package/dist/src/bind/sources.d.ts +148 -0
- package/dist/src/bind/sources.d.ts.map +1 -0
- package/dist/src/bind/sources.js +116 -0
- package/dist/src/bind/sources.js.map +1 -0
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +4 -1
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +11 -1
- package/dist/src/internal.js.map +1 -1
- package/dist/src/query/builder.d.ts +3257 -0
- package/dist/src/query/builder.d.ts.map +1 -0
- package/dist/src/query/builder.js +126 -0
- package/dist/src/query/builder.js.map +1 -0
- package/dist/src/query/index.d.ts +108 -0
- package/dist/src/query/index.d.ts.map +1 -0
- package/dist/src/query/index.js +76 -0
- package/dist/src/query/index.js.map +1 -0
- package/dist/src/query/library.d.ts +3241 -0
- package/dist/src/query/library.d.ts.map +1 -0
- package/dist/src/query/library.js +114 -0
- package/dist/src/query/library.js.map +1 -0
- package/dist/src/query/queries.d.ts +4696 -0
- package/dist/src/query/queries.d.ts.map +1 -0
- package/dist/src/query/queries.js +129 -0
- package/dist/src/query/queries.js.map +1 -0
- package/dist/src/query/saved.d.ts +72 -0
- package/dist/src/query/saved.d.ts.map +1 -0
- package/dist/src/query/saved.js +84 -0
- package/dist/src/query/saved.js.map +1 -0
- package/dist/src/query/steps.d.ts +613 -0
- package/dist/src/query/steps.d.ts.map +1 -0
- package/dist/src/query/steps.js +316 -0
- package/dist/src/query/steps.js.map +1 -0
- package/dist/src/query/types.d.ts +444 -0
- package/dist/src/query/types.d.ts.map +1 -0
- package/dist/src/query/types.js +113 -0
- package/dist/src/query/types.js.map +1 -0
- package/dist/src/studio/builder.d.ts +3123 -0
- package/dist/src/studio/builder.d.ts.map +1 -0
- package/dist/src/studio/builder.js +115 -0
- package/dist/src/studio/builder.js.map +1 -0
- package/dist/src/studio/canvas.d.ts +83 -0
- package/dist/src/studio/canvas.d.ts.map +1 -0
- package/dist/src/studio/canvas.js +71 -0
- package/dist/src/studio/canvas.js.map +1 -0
- package/dist/src/studio/component.d.ts +178 -0
- package/dist/src/studio/component.d.ts.map +1 -0
- package/dist/src/studio/component.js +189 -0
- package/dist/src/studio/component.js.map +1 -0
- package/dist/src/studio/index.d.ts +104 -0
- package/dist/src/studio/index.d.ts.map +1 -0
- package/dist/src/studio/index.js +75 -0
- package/dist/src/studio/index.js.map +1 -0
- package/dist/src/studio/inspector.d.ts +208 -0
- package/dist/src/studio/inspector.d.ts.map +1 -0
- package/dist/src/studio/inspector.js +155 -0
- package/dist/src/studio/inspector.js.map +1 -0
- package/dist/src/studio/library.d.ts +3506 -0
- package/dist/src/studio/library.d.ts.map +1 -0
- package/dist/src/studio/library.js +245 -0
- package/dist/src/studio/library.js.map +1 -0
- package/dist/src/studio/page.d.ts +305 -0
- package/dist/src/studio/page.d.ts.map +1 -0
- package/dist/src/studio/page.js +105 -0
- package/dist/src/studio/page.js.map +1 -0
- package/dist/src/studio/pages.d.ts +10929 -0
- package/dist/src/studio/pages.d.ts.map +1 -0
- package/dist/src/studio/pages.js +502 -0
- package/dist/src/studio/pages.js.map +1 -0
- package/dist/src/studio/palette.d.ts +179 -0
- package/dist/src/studio/palette.d.ts.map +1 -0
- package/dist/src/studio/palette.js +120 -0
- package/dist/src/studio/palette.js.map +1 -0
- package/dist/src/studio/publish.d.ts +397 -0
- package/dist/src/studio/publish.d.ts.map +1 -0
- package/dist/src/studio/publish.js +198 -0
- package/dist/src/studio/publish.js.map +1 -0
- package/dist/src/ui.d.ts +16 -3
- package/dist/src/ui.d.ts.map +1 -1
- package/dist/src/ui.js +21 -1
- package/dist/src/ui.js.map +1 -1
- package/dist/test/bind/data/data.examples.d.ts +76 -1
- package/dist/test/bind/data/data.examples.d.ts.map +1 -1
- package/dist/test/bind/data/data.examples.js +176 -3
- package/dist/test/bind/data/data.examples.js.map +1 -1
- package/dist/test/bind/func/func.examples.d.ts +8 -0
- package/dist/test/bind/func/func.examples.d.ts.map +1 -1
- package/dist/test/bind/func/func.examples.js +4 -3
- package/dist/test/bind/func/func.examples.js.map +1 -1
- package/dist/test/bind/record/record.examples.d.ts +65 -1
- package/dist/test/bind/record/record.examples.d.ts.map +1 -1
- package/dist/test/bind/record/record.examples.js +21 -3
- package/dist/test/bind/record/record.examples.js.map +1 -1
- package/dist/test/query/query.examples.d.ts +5022 -0
- package/dist/test/query/query.examples.d.ts.map +1 -0
- package/dist/test/query/query.examples.js +467 -0
- package/dist/test/query/query.examples.js.map +1 -0
- package/dist/test/studio/component.examples.d.ts +7 -0
- package/dist/test/studio/component.examples.d.ts.map +1 -0
- package/dist/test/studio/component.examples.js +46 -0
- package/dist/test/studio/component.examples.js.map +1 -0
- package/dist/test/studio/page.examples.d.ts +7 -0
- package/dist/test/studio/page.examples.d.ts.map +1 -0
- package/dist/test/studio/page.examples.js +64 -0
- package/dist/test/studio/page.examples.js.map +1 -0
- package/dist/test/studio/studio.examples.d.ts +1766 -0
- package/dist/test/studio/studio.examples.d.ts.map +1 -0
- package/dist/test/studio/studio.examples.js +354 -0
- package/dist/test/studio/studio.examples.js.map +1 -0
- package/package.json +9 -8
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The builder's palette (#994) — what it shows of the components a surface
|
|
7
|
+
* lists and of the project's pages, computed in East for the `StudioBuilder`
|
|
8
|
+
* renderer, which draws the palette: the components by category, and the
|
|
9
|
+
* project's pages, in one pane beside the canvas.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
import { ArrayType, BooleanType, DictType, IntegerType, OptionType, StringType, StructType } from "@elaraai/east";
|
|
14
|
+
/**
|
|
15
|
+
* The names a builder shares, by its `id`: the UI store key of the page open
|
|
16
|
+
* in it — which the page library writes when it opens a page — and the
|
|
17
|
+
* drag-source ids of its palette's two libraries.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* A builder and a page library with the same `id` open one page together, as
|
|
21
|
+
* `Slice.bind` shares a slice by key.
|
|
22
|
+
*
|
|
23
|
+
* @param id - The builder's name, when a surface holds more than one; omitted, the one builder
|
|
24
|
+
* @returns The key and ids
|
|
25
|
+
*/
|
|
26
|
+
export declare function builderKeys(id: string | undefined): {
|
|
27
|
+
/** The open page's UI store key — a `Studio.Types.Key`. */
|
|
28
|
+
page: string;
|
|
29
|
+
/** The palette's components library's drag-source id — what the canvas takes cards from. */
|
|
30
|
+
components: string;
|
|
31
|
+
/** The palette's pages library's id. */
|
|
32
|
+
pages: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* A listed component, as its palette card shows it.
|
|
36
|
+
*
|
|
37
|
+
* @property meta - The meta line: the datasets its code reads, or, placed, `ON CANVAS · ×N`
|
|
38
|
+
* @property placed - Whether the canvas has one of its placements selected
|
|
39
|
+
*/
|
|
40
|
+
export declare const PaletteCardType: StructType<{
|
|
41
|
+
readonly meta: StringType;
|
|
42
|
+
readonly placed: BooleanType;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* A page of the project, as the palette's Pages tab lists it.
|
|
46
|
+
*
|
|
47
|
+
* @property page - The page's name in the project
|
|
48
|
+
* @property title - Its title
|
|
49
|
+
* @property meta - Its status: `LIVE · Vn`, `DRAFT · Vn LIVE` or `DRAFT`
|
|
50
|
+
* @property live - Whether it is live
|
|
51
|
+
*/
|
|
52
|
+
export declare const PalettePageType: StructType<{
|
|
53
|
+
readonly page: StringType;
|
|
54
|
+
readonly title: StringType;
|
|
55
|
+
readonly meta: StringType;
|
|
56
|
+
readonly live: BooleanType;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* Each listed component's card, by key: its meta line and whether it is
|
|
60
|
+
* placed. A card's meta line names the datasets its component reads, joined
|
|
61
|
+
* with ` · `; the component the selected placement places is placed, and its
|
|
62
|
+
* line counts the page's placements of it instead. A key two components
|
|
63
|
+
* share keeps the first one's card.
|
|
64
|
+
*/
|
|
65
|
+
export declare const paletteCards: import("@elaraai/east").CallableFunctionExpr<[ArrayType<StructType<{
|
|
66
|
+
readonly key: StringType;
|
|
67
|
+
readonly name: StringType;
|
|
68
|
+
readonly category: StringType;
|
|
69
|
+
readonly icon: StringType;
|
|
70
|
+
readonly span: IntegerType;
|
|
71
|
+
readonly description: OptionType<StringType>;
|
|
72
|
+
readonly frame: import("@elaraai/east").VariantType<{
|
|
73
|
+
readonly card: import("@elaraai/east").NullType;
|
|
74
|
+
readonly none: import("@elaraai/east").NullType;
|
|
75
|
+
}>;
|
|
76
|
+
readonly tags: ArrayType<StringType>;
|
|
77
|
+
readonly collections: ArrayType<StringType>;
|
|
78
|
+
readonly deprecated: BooleanType;
|
|
79
|
+
readonly reads: StructType<{
|
|
80
|
+
readonly paths: ArrayType<ArrayType<import("@elaraai/east").VariantType<{
|
|
81
|
+
readonly field: StringType;
|
|
82
|
+
}>>>;
|
|
83
|
+
readonly functions: ArrayType<StringType>;
|
|
84
|
+
readonly records: ArrayType<StringType>;
|
|
85
|
+
readonly pages: ArrayType<ArrayType<import("@elaraai/east").VariantType<{
|
|
86
|
+
readonly field: StringType;
|
|
87
|
+
}>>>;
|
|
88
|
+
}>;
|
|
89
|
+
readonly fingerprint: StringType;
|
|
90
|
+
readonly render: import("@elaraai/east").FunctionType<[], import("@elaraai/east").RecursiveType<import("@elaraai/east-ui").UIComponentNode>>;
|
|
91
|
+
}>>, ArrayType<StructType<{
|
|
92
|
+
readonly key: StringType;
|
|
93
|
+
readonly row: StringType;
|
|
94
|
+
readonly span: IntegerType;
|
|
95
|
+
readonly height: OptionType<IntegerType>;
|
|
96
|
+
readonly align: import("@elaraai/east").VariantType<{
|
|
97
|
+
readonly top: import("@elaraai/east").NullType;
|
|
98
|
+
readonly center: import("@elaraai/east").NullType;
|
|
99
|
+
readonly stretch: import("@elaraai/east").NullType;
|
|
100
|
+
}>;
|
|
101
|
+
readonly title: OptionType<StringType>;
|
|
102
|
+
readonly component: StringType;
|
|
103
|
+
readonly fingerprint: StringType;
|
|
104
|
+
}>>, OptionType<StringType>], DictType<StringType, StructType<{
|
|
105
|
+
readonly meta: StringType;
|
|
106
|
+
readonly placed: BooleanType;
|
|
107
|
+
}>>>;
|
|
108
|
+
/**
|
|
109
|
+
* A project's pages, in key order, as the palette's Pages tab lists them —
|
|
110
|
+
* each with its title and its status. Templates and other projects' pages are
|
|
111
|
+
* not listed.
|
|
112
|
+
*/
|
|
113
|
+
export declare const palettePages: import("@elaraai/east").CallableFunctionExpr<[DictType<StructType<{
|
|
114
|
+
readonly project: StringType;
|
|
115
|
+
readonly page: StringType;
|
|
116
|
+
}>, import("@elaraai/east").VariantType<{
|
|
117
|
+
readonly page: StructType<{
|
|
118
|
+
readonly draft: StructType<{
|
|
119
|
+
readonly title: StringType;
|
|
120
|
+
readonly cells: ArrayType<StructType<{
|
|
121
|
+
readonly key: StringType;
|
|
122
|
+
readonly row: StringType;
|
|
123
|
+
readonly span: IntegerType;
|
|
124
|
+
readonly height: OptionType<IntegerType>;
|
|
125
|
+
readonly align: import("@elaraai/east").VariantType<{
|
|
126
|
+
readonly top: import("@elaraai/east").NullType;
|
|
127
|
+
readonly center: import("@elaraai/east").NullType;
|
|
128
|
+
readonly stretch: import("@elaraai/east").NullType;
|
|
129
|
+
}>;
|
|
130
|
+
readonly title: OptionType<StringType>;
|
|
131
|
+
readonly component: StringType;
|
|
132
|
+
readonly fingerprint: StringType;
|
|
133
|
+
}>>;
|
|
134
|
+
}>;
|
|
135
|
+
readonly live: OptionType<StructType<{
|
|
136
|
+
readonly version: IntegerType;
|
|
137
|
+
readonly page: StructType<{
|
|
138
|
+
readonly title: StringType;
|
|
139
|
+
readonly cells: ArrayType<StructType<{
|
|
140
|
+
readonly key: StringType;
|
|
141
|
+
readonly row: StringType;
|
|
142
|
+
readonly span: IntegerType;
|
|
143
|
+
readonly height: OptionType<IntegerType>;
|
|
144
|
+
readonly align: import("@elaraai/east").VariantType<{
|
|
145
|
+
readonly top: import("@elaraai/east").NullType;
|
|
146
|
+
readonly center: import("@elaraai/east").NullType;
|
|
147
|
+
readonly stretch: import("@elaraai/east").NullType;
|
|
148
|
+
}>;
|
|
149
|
+
readonly title: OptionType<StringType>;
|
|
150
|
+
readonly component: StringType;
|
|
151
|
+
readonly fingerprint: StringType;
|
|
152
|
+
}>>;
|
|
153
|
+
}>;
|
|
154
|
+
}>>;
|
|
155
|
+
}>;
|
|
156
|
+
readonly template: StructType<{
|
|
157
|
+
readonly title: StringType;
|
|
158
|
+
readonly cells: ArrayType<StructType<{
|
|
159
|
+
readonly key: StringType;
|
|
160
|
+
readonly row: StringType;
|
|
161
|
+
readonly span: IntegerType;
|
|
162
|
+
readonly height: OptionType<IntegerType>;
|
|
163
|
+
readonly align: import("@elaraai/east").VariantType<{
|
|
164
|
+
readonly top: import("@elaraai/east").NullType;
|
|
165
|
+
readonly center: import("@elaraai/east").NullType;
|
|
166
|
+
readonly stretch: import("@elaraai/east").NullType;
|
|
167
|
+
}>;
|
|
168
|
+
readonly title: OptionType<StringType>;
|
|
169
|
+
readonly component: StringType;
|
|
170
|
+
readonly fingerprint: StringType;
|
|
171
|
+
}>>;
|
|
172
|
+
}>;
|
|
173
|
+
}>>, StringType], ArrayType<StructType<{
|
|
174
|
+
readonly page: StringType;
|
|
175
|
+
readonly title: StringType;
|
|
176
|
+
readonly meta: StringType;
|
|
177
|
+
readonly live: BooleanType;
|
|
178
|
+
}>>>;
|
|
179
|
+
//# sourceMappingURL=palette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../../src/studio/palette.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAEH,OAAO,EACH,SAAS,EACT,WAAW,EACX,QAAQ,EAER,WAAW,EACX,UAAU,EACV,UAAU,EACV,UAAU,EAGb,MAAM,eAAe,CAAC;AAQvB;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG;IACjD,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,4FAA4F;IAC5F,UAAU,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;CACjB,CAOA;AAMD;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;EAAwD,CAAC;AAErF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;;;;EAK1B,CAAC;AAMH;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiCxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwBxB,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The builder's palette (#994) — what it shows of the components a surface
|
|
7
|
+
* lists and of the project's pages, computed in East for the `StudioBuilder`
|
|
8
|
+
* renderer, which draws the palette: the components by category, and the
|
|
9
|
+
* project's pages, in one pane beside the canvas.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
import { ArrayType, BooleanType, DictType, East, IntegerType, OptionType, StringType, StructType, none, some, } from "@elaraai/east";
|
|
14
|
+
import { StudioComponentType } from "./component.js";
|
|
15
|
+
import { StudioCellType, StudioPagesType, pageStatus } from "./pages.js";
|
|
16
|
+
// ============================================================================
|
|
17
|
+
// The builder's shared keys
|
|
18
|
+
// ============================================================================
|
|
19
|
+
/**
|
|
20
|
+
* The names a builder shares, by its `id`: the UI store key of the page open
|
|
21
|
+
* in it — which the page library writes when it opens a page — and the
|
|
22
|
+
* drag-source ids of its palette's two libraries.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* A builder and a page library with the same `id` open one page together, as
|
|
26
|
+
* `Slice.bind` shares a slice by key.
|
|
27
|
+
*
|
|
28
|
+
* @param id - The builder's name, when a surface holds more than one; omitted, the one builder
|
|
29
|
+
* @returns The key and ids
|
|
30
|
+
*/
|
|
31
|
+
export function builderKeys(id) {
|
|
32
|
+
const suffix = id === undefined ? "" : `.${id}`;
|
|
33
|
+
return {
|
|
34
|
+
page: `studio.builder${suffix}.page`,
|
|
35
|
+
components: `studio.components${suffix}`,
|
|
36
|
+
pages: `studio.pages${suffix}`,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
// ============================================================================
|
|
40
|
+
// Types
|
|
41
|
+
// ============================================================================
|
|
42
|
+
/**
|
|
43
|
+
* A listed component, as its palette card shows it.
|
|
44
|
+
*
|
|
45
|
+
* @property meta - The meta line: the datasets its code reads, or, placed, `ON CANVAS · ×N`
|
|
46
|
+
* @property placed - Whether the canvas has one of its placements selected
|
|
47
|
+
*/
|
|
48
|
+
export const PaletteCardType = StructType({ meta: StringType, placed: BooleanType });
|
|
49
|
+
/**
|
|
50
|
+
* A page of the project, as the palette's Pages tab lists it.
|
|
51
|
+
*
|
|
52
|
+
* @property page - The page's name in the project
|
|
53
|
+
* @property title - Its title
|
|
54
|
+
* @property meta - Its status: `LIVE · Vn`, `DRAFT · Vn LIVE` or `DRAFT`
|
|
55
|
+
* @property live - Whether it is live
|
|
56
|
+
*/
|
|
57
|
+
export const PalettePageType = StructType({
|
|
58
|
+
page: StringType,
|
|
59
|
+
title: StringType,
|
|
60
|
+
meta: StringType,
|
|
61
|
+
live: BooleanType,
|
|
62
|
+
});
|
|
63
|
+
// ============================================================================
|
|
64
|
+
// What the palette shows
|
|
65
|
+
// ============================================================================
|
|
66
|
+
/**
|
|
67
|
+
* Each listed component's card, by key: its meta line and whether it is
|
|
68
|
+
* placed. A card's meta line names the datasets its component reads, joined
|
|
69
|
+
* with ` · `; the component the selected placement places is placed, and its
|
|
70
|
+
* line counts the page's placements of it instead. A key two components
|
|
71
|
+
* share keeps the first one's card.
|
|
72
|
+
*/
|
|
73
|
+
export const paletteCards = East.function([ArrayType(StudioComponentType), ArrayType(StudioCellType), OptionType(StringType)], DictType(StringType, PaletteCardType), ($, listed, cells, selectedCell) => {
|
|
74
|
+
const placements = $.let(new Map(), DictType(StringType, IntegerType));
|
|
75
|
+
$.for(cells, ($2, cell) => {
|
|
76
|
+
$2(placements.insertOrUpdate(cell.component, 1n, (_$3, count) => count.add(1n)));
|
|
77
|
+
});
|
|
78
|
+
// The component the selected placement places.
|
|
79
|
+
const selected = $.let(selectedCell.match({
|
|
80
|
+
some: (_$2, cellKey) => cells.firstMap((_$3, cell) => cell.key.equal(cellKey).ifElse(() => East.value(some(cell.component), OptionType(StringType)), () => East.value(none, OptionType(StringType)))),
|
|
81
|
+
none: (_$2) => East.value(none, OptionType(StringType)),
|
|
82
|
+
}), OptionType(StringType));
|
|
83
|
+
const cards = $.let(new Map(), DictType(StringType, PaletteCardType));
|
|
84
|
+
$.for(listed, ($2, component) => {
|
|
85
|
+
const reads = $2.let(component.reads.paths.concat(component.reads.pages)
|
|
86
|
+
.map((_$3, path) => path.get(path.size().subtract(1n)).unwrap("field")));
|
|
87
|
+
const placed = $2.let(East.equal(selected, some(component.key)));
|
|
88
|
+
const count = $2.let(placements.tryGet(component.key).match({
|
|
89
|
+
some: (_$3, n) => n,
|
|
90
|
+
none: (_$3) => East.value(0n),
|
|
91
|
+
}));
|
|
92
|
+
const meta = $2.let(placed.ifElse(() => East.str `ON CANVAS · ×${East.print(count)}`, () => reads.size().equal(0n).ifElse(() => East.value("no data"), () => reads.stringJoin(" · "))));
|
|
93
|
+
$2(cards.insertOrUpdate(component.key, { meta, placed }, (_$3, existing) => existing));
|
|
94
|
+
});
|
|
95
|
+
return cards;
|
|
96
|
+
});
|
|
97
|
+
/**
|
|
98
|
+
* A project's pages, in key order, as the palette's Pages tab lists them —
|
|
99
|
+
* each with its title and its status. Templates and other projects' pages are
|
|
100
|
+
* not listed.
|
|
101
|
+
*/
|
|
102
|
+
export const palettePages = East.function([StudioPagesType, StringType], ArrayType(PalettePageType), ($, pages, project) => {
|
|
103
|
+
const listed = $.let([], ArrayType(PalettePageType));
|
|
104
|
+
$.for(pages, ($2, entry, key) => {
|
|
105
|
+
$2.if(key.project.equal(project), ($3) => {
|
|
106
|
+
$3.match(entry, {
|
|
107
|
+
page: ($4, page) => {
|
|
108
|
+
const live = $4.let(pageStatus(page).hasTag("live"));
|
|
109
|
+
const meta = $4.let(page.live.match({
|
|
110
|
+
some: (_$5, version) => live.ifElse(() => East.str `LIVE · V${East.print(version.version)}`, () => East.str `DRAFT · V${East.print(version.version)} LIVE`),
|
|
111
|
+
none: (_$5) => East.value("DRAFT"),
|
|
112
|
+
}));
|
|
113
|
+
$4(listed.pushLast({ page: key.page, title: page.draft.title, meta, live }));
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
return listed;
|
|
119
|
+
});
|
|
120
|
+
//# sourceMappingURL=palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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