mapples 0.2.0-beta.3 → 0.2.0-beta.4
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/api/objects.d.ts +3 -1
- package/dist/api/objects.js +24 -1
- package/dist/api/objects.js.map +1 -1
- package/dist/codegen/emit.d.ts +2 -31
- package/dist/codegen/emit.js +7 -147
- package/dist/codegen/emit.js.map +1 -1
- package/dist/codegen/imports.d.ts +1 -17
- package/dist/codegen/imports.js +2 -116
- package/dist/codegen/imports.js.map +1 -1
- package/dist/codegen/instances.d.ts +2 -13
- package/dist/codegen/instances.js +23 -134
- package/dist/codegen/instances.js.map +1 -1
- package/dist/codegen/styles.d.ts +1 -11
- package/dist/codegen/styles.js +2 -130
- package/dist/codegen/styles.js.map +1 -1
- package/dist/merge/threeWay.d.ts +1 -1
- package/dist/merge/toEdits.d.ts +1 -3
- package/dist/merge/toEdits.js +3 -94
- package/dist/merge/toEdits.js.map +1 -1
- package/dist/project/baseStore.d.ts +11 -1
- package/dist/project/baseStore.js +13 -0
- package/dist/project/baseStore.js.map +1 -1
- package/dist/services/syncEngine.d.ts +1 -1
- package/dist/services/syncEngine.js +260 -39
- package/dist/services/syncEngine.js.map +1 -1
- package/dist/types.d.ts +19 -1
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instances.js","sourceRoot":"","sources":["../../src/codegen/instances.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"instances.js","sourceRoot":"","sources":["../../src/codegen/instances.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,mEAAmE;AACnE,2EAA2E;AAC3E,2BAA2B;AAE3B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE1D,OAAO,EACL,cAAc,IAAI,MAAM,GAGzB,MAAM,kBAAkB,CAA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E,CAAC;IACrE,CAAC;IACD,OAAO,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;AACpD,CAAC"}
|
package/dist/codegen/styles.d.ts
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/** Where `Styler` comes from in app code. */
|
|
3
|
-
export declare const STYLE_MODULE = "@mapples/style";
|
|
4
|
-
export interface HoistedStyles {
|
|
5
|
-
dictName: string;
|
|
6
|
-
/** Dictionary entries in document order: `[key, style object]`. */
|
|
7
|
-
entries: [string, unknown][];
|
|
8
|
-
/** The expression a node's `styled` key prints as, or undefined to print the literal. */
|
|
9
|
-
refFor: (node: RenderDomNode, key: string, value: unknown) => string | undefined;
|
|
10
|
-
}
|
|
11
|
-
export declare function hoistStyles(root: RenderDomNode, dictName?: string): HoistedStyles;
|
|
1
|
+
export { hoistStyles, STYLE_MODULE, type HoistedStyles } from '@mapples/codegen';
|
package/dist/codegen/styles.js
CHANGED
|
@@ -1,131 +1,3 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
// of the file, and the tag reads `styled={{ style: styles.signInText }}`.
|
|
4
|
-
// Keys come from what the element shows (its text, label, placeholder…) and
|
|
5
|
-
// what it is, so a developer can find a style by reading the JSX.
|
|
6
|
-
/** Where `Styler` comes from in app code. */
|
|
7
|
-
export const STYLE_MODULE = '@mapples/style';
|
|
8
|
-
/** `styled` keys that hold a style object, and the word appended to the entry key for each. */
|
|
9
|
-
const STYLED_SUFFIX = {
|
|
10
|
-
style: '',
|
|
11
|
-
styleImage: 'Picture',
|
|
12
|
-
styleTypography: 'Label',
|
|
13
|
-
styleSvg: 'Glyph',
|
|
14
|
-
contentContainerStyle: 'Content',
|
|
15
|
-
};
|
|
16
|
-
/** The word for a node type inside an entry key. */
|
|
17
|
-
const TYPE_WORD = {
|
|
18
|
-
View: 'view',
|
|
19
|
-
SafeAreaView: 'screen',
|
|
20
|
-
ScrollView: 'scroll',
|
|
21
|
-
FlatList: 'list',
|
|
22
|
-
FormView: 'form',
|
|
23
|
-
Text: 'text',
|
|
24
|
-
Image: 'image',
|
|
25
|
-
Button: 'button',
|
|
26
|
-
SubmitButton: 'button',
|
|
27
|
-
TextInput: 'input',
|
|
28
|
-
TextField: 'input',
|
|
29
|
-
Vector: 'icon',
|
|
30
|
-
Icon: 'icon',
|
|
31
|
-
Custom: 'custom',
|
|
32
|
-
};
|
|
33
|
-
/** Props whose text names an element well enough to name its style. */
|
|
34
|
-
const HINT_PROPS = ['text', 'label', 'placeholder', 'title', 'alt', 'fieldName'];
|
|
35
|
-
const capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1);
|
|
36
|
-
/**
|
|
37
|
-
* "Please enter username and password" -> "pleaseEnterUsername". Words are
|
|
38
|
-
* letters only — a price like "0.99$" names nothing — and the result is a
|
|
39
|
-
* valid identifier start or empty.
|
|
40
|
-
*/
|
|
41
|
-
function hintWords(text) {
|
|
42
|
-
const words = text
|
|
43
|
-
.replace(/[^A-Za-z ]+/g, ' ')
|
|
44
|
-
.split(/\s+/)
|
|
45
|
-
.filter(Boolean)
|
|
46
|
-
.slice(0, 3)
|
|
47
|
-
.map((w) => w.toLowerCase());
|
|
48
|
-
if (words.length === 0)
|
|
49
|
-
return '';
|
|
50
|
-
return words[0] + words.slice(1).map(capitalize).join('');
|
|
51
|
-
}
|
|
52
|
-
function typeWord(node) {
|
|
53
|
-
if (node.type === 'Custom') {
|
|
54
|
-
const name = node.props.name;
|
|
55
|
-
return typeof name === 'string' && name !== ''
|
|
56
|
-
? name.charAt(0).toLowerCase() + name.slice(1)
|
|
57
|
-
: 'custom';
|
|
58
|
-
}
|
|
59
|
-
return TYPE_WORD[node.type] ?? node.type.charAt(0).toLowerCase() + node.type.slice(1);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* The words an element's style keys are built from: `stem` is what it shows
|
|
63
|
-
* (`signIn`, `companyLogo`) or what it is when it shows nothing (`view`);
|
|
64
|
-
* `style` adds the type to a shown stem (`signInText`), the other `styled`
|
|
65
|
-
* keys add their own word to the stem (`signInLabel`, `companyLogoPicture`).
|
|
66
|
-
*/
|
|
67
|
-
function keyWords(node, isRoot) {
|
|
68
|
-
if (isRoot)
|
|
69
|
-
return { stem: 'root', style: 'root' };
|
|
70
|
-
const props = node.type === 'Custom' ? (node.props.layout ?? {}) : node.props;
|
|
71
|
-
const type = typeWord(node);
|
|
72
|
-
for (const prop of HINT_PROPS) {
|
|
73
|
-
const v = props[prop];
|
|
74
|
-
if (typeof v === 'string' && v.trim() !== '') {
|
|
75
|
-
const hint = hintWords(v);
|
|
76
|
-
if (hint !== '')
|
|
77
|
-
return { stem: hint, style: `${hint}${capitalize(type)}` };
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return { stem: type, style: type };
|
|
81
|
-
}
|
|
82
|
-
function styledOf(node) {
|
|
83
|
-
const styled = node.type === 'Custom'
|
|
84
|
-
? (node.props.layout ?? {}).styled
|
|
85
|
-
: node.props.styled;
|
|
86
|
-
return typeof styled === 'object' && styled !== null && !Array.isArray(styled)
|
|
87
|
-
? styled
|
|
88
|
-
: null;
|
|
89
|
-
}
|
|
90
|
-
export function hoistStyles(root, dictName = 'styles') {
|
|
91
|
-
const entries = [];
|
|
92
|
-
const taken = new Set();
|
|
93
|
-
const refs = new Map(); // `${sid}|${styledKey}` -> entry key
|
|
94
|
-
const unique = (key) => {
|
|
95
|
-
let candidate = key;
|
|
96
|
-
for (let n = 2; taken.has(candidate); n += 1)
|
|
97
|
-
candidate = `${key}${n}`;
|
|
98
|
-
taken.add(candidate);
|
|
99
|
-
return candidate;
|
|
100
|
-
};
|
|
101
|
-
const visit = (node, isRoot) => {
|
|
102
|
-
const styled = styledOf(node);
|
|
103
|
-
if (styled) {
|
|
104
|
-
const words = keyWords(node, isRoot);
|
|
105
|
-
for (const [styledKey, value] of Object.entries(styled)) {
|
|
106
|
-
if (!(styledKey in STYLED_SUFFIX))
|
|
107
|
-
continue;
|
|
108
|
-
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
109
|
-
continue;
|
|
110
|
-
if (Object.keys(value).length === 0)
|
|
111
|
-
continue;
|
|
112
|
-
const suffix = STYLED_SUFFIX[styledKey];
|
|
113
|
-
const key = unique(suffix === '' ? words.style : `${words.stem}${suffix}`);
|
|
114
|
-
entries.push([key, value]);
|
|
115
|
-
refs.set(`${node.sid}|${styledKey}`, key);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
for (const child of node.children)
|
|
119
|
-
visit(child, false);
|
|
120
|
-
};
|
|
121
|
-
visit(root, true);
|
|
122
|
-
return {
|
|
123
|
-
dictName,
|
|
124
|
-
entries,
|
|
125
|
-
refFor: (node, key) => {
|
|
126
|
-
const entry = refs.get(`${node.sid}|${key}`);
|
|
127
|
-
return entry === undefined ? undefined : `${dictName}.${entry}`;
|
|
128
|
-
},
|
|
129
|
-
};
|
|
130
|
-
}
|
|
1
|
+
// Hoisted `Styler.create` dictionaries — live in @mapples/codegen (pure).
|
|
2
|
+
export { hoistStyles, STYLE_MODULE } from '@mapples/codegen';
|
|
131
3
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/codegen/styles.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/codegen/styles.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,EAAE,WAAW,EAAE,YAAY,EAAsB,MAAM,kBAAkB,CAAC"}
|
package/dist/merge/threeWay.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type RenderDomNode } from '../types.js';
|
|
2
2
|
export interface ConflictDetail {
|
|
3
3
|
sid: string;
|
|
4
|
-
reason: 'same-prop' | 'delete-vs-edit';
|
|
4
|
+
reason: 'same-prop' | 'delete-vs-edit' | 'source-text';
|
|
5
5
|
props?: string[];
|
|
6
6
|
localValue?: unknown;
|
|
7
7
|
remoteValue?: unknown;
|
package/dist/merge/toEdits.d.ts
CHANGED
package/dist/merge/toEdits.js
CHANGED
|
@@ -1,95 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
// reparented sid is gone before its new parent inserts it), then shell
|
|
5
|
-
// updates, insertions, and reorders.
|
|
6
|
-
import { sidecarFilled, sidecarOf } from '../types.js';
|
|
7
|
-
import { indexTree } from './diff.js';
|
|
8
|
-
import { deepEqual } from './mergePatch.js';
|
|
9
|
-
export function treeToEdits(local, merged) {
|
|
10
|
-
const lIdx = indexTree(local);
|
|
11
|
-
const mIdx = indexTree(merged);
|
|
12
|
-
if (local && merged && local.sid !== merged.sid) {
|
|
13
|
-
// Root replaced: one subtree swap.
|
|
14
|
-
return [{ kind: 'replaceSubtree', sid: local.sid, node: merged }];
|
|
15
|
-
}
|
|
16
|
-
const removes = [];
|
|
17
|
-
const shells = [];
|
|
18
|
-
const inserts = [];
|
|
19
|
-
const moves = [];
|
|
20
|
-
// Removals: local nodes that vanished from merged, or were reparented (their
|
|
21
|
-
// new parent re-inserts the merged subtree). Only topmost removals needed.
|
|
22
|
-
for (const [sid, lEntry] of lIdx) {
|
|
23
|
-
const parentRemoved = lEntry.parentSid !== null &&
|
|
24
|
-
(!mIdx.has(lEntry.parentSid) ||
|
|
25
|
-
(lIdx.has(lEntry.parentSid) && removedOrReparented(lEntry.parentSid, lIdx, mIdx)));
|
|
26
|
-
if (parentRemoved)
|
|
27
|
-
continue;
|
|
28
|
-
if (removedOrReparented(sid, lIdx, mIdx)) {
|
|
29
|
-
removes.push({ kind: 'removeNode', sid });
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
// Is this local node (or an ancestor) getting removed/re-inserted wholesale?
|
|
33
|
-
const insideRemoved = (sid) => {
|
|
34
|
-
let cursor = sid;
|
|
35
|
-
while (cursor !== null) {
|
|
36
|
-
if (removedOrReparented(cursor, lIdx, mIdx))
|
|
37
|
-
return true;
|
|
38
|
-
cursor = lIdx.get(cursor)?.parentSid ?? null;
|
|
39
|
-
}
|
|
40
|
-
return false;
|
|
41
|
-
};
|
|
42
|
-
for (const [sid, mEntry] of mIdx) {
|
|
43
|
-
const lEntry = lIdx.get(sid);
|
|
44
|
-
if (lEntry && !insideRemoved(sid)) {
|
|
45
|
-
const typeChanged = lEntry.node.type !== mEntry.node.type;
|
|
46
|
-
const sidecarChanged = !deepEqual(sidecarFilled(lEntry.node), sidecarFilled(mEntry.node));
|
|
47
|
-
if (typeChanged || sidecarChanged || !deepEqual(lEntry.node.props, mEntry.node.props)) {
|
|
48
|
-
shells.push({
|
|
49
|
-
kind: 'setProps',
|
|
50
|
-
sid,
|
|
51
|
-
props: mEntry.node.props,
|
|
52
|
-
...(typeChanged ? { type: mEntry.node.type } : {}),
|
|
53
|
-
...sidecarOf(mEntry.node),
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
// Insertions + reorders per parent present in both trees.
|
|
59
|
-
for (const [sid, mEntry] of mIdx) {
|
|
60
|
-
const lEntry = lIdx.get(sid);
|
|
61
|
-
if (!lEntry || insideRemoved(sid))
|
|
62
|
-
continue;
|
|
63
|
-
const lKids = lEntry.node.children.map((c) => c.sid);
|
|
64
|
-
const mKids = mEntry.node.children.map((c) => c.sid);
|
|
65
|
-
for (const kid of mKids) {
|
|
66
|
-
const isChildHereAlready = lKids.includes(kid) && !removedOrReparented(kid, lIdx, mIdx);
|
|
67
|
-
if (!isChildHereAlready) {
|
|
68
|
-
inserts.push({
|
|
69
|
-
kind: 'insertChild',
|
|
70
|
-
parentSid: sid,
|
|
71
|
-
at: mKids.indexOf(kid),
|
|
72
|
-
node: mIdx.get(kid).node,
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
const surviving = lKids.filter((k) => mKids.includes(k) && !removedOrReparented(k, lIdx, mIdx));
|
|
77
|
-
const targetOrder = mKids.filter((k) => surviving.includes(k));
|
|
78
|
-
if (!deepEqual(surviving, targetOrder)) {
|
|
79
|
-
for (let i = 0; i < mKids.length; i++) {
|
|
80
|
-
moves.push({ kind: 'moveChild', parentSid: sid, sid: mKids[i], to: i });
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return [...removes, ...shells, ...inserts, ...moves];
|
|
85
|
-
}
|
|
86
|
-
function removedOrReparented(sid, lIdx, mIdx) {
|
|
87
|
-
const lEntry = lIdx.get(sid);
|
|
88
|
-
const mEntry = mIdx.get(sid);
|
|
89
|
-
if (!lEntry)
|
|
90
|
-
return false;
|
|
91
|
-
if (!mEntry)
|
|
92
|
-
return true;
|
|
93
|
-
return lEntry.parentSid !== mEntry.parentSid;
|
|
94
|
-
}
|
|
1
|
+
// Document -> file edits — lives in @mapples/codegen (pure), shared with the
|
|
2
|
+
// Creator's code editor.
|
|
3
|
+
export { treeToEdits } from '@mapples/codegen';
|
|
95
4
|
//# sourceMappingURL=toEdits.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toEdits.js","sourceRoot":"","sources":["../../src/merge/toEdits.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"toEdits.js","sourceRoot":"","sources":["../../src/merge/toEdits.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,yBAAyB;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import type { RenderDomNode } from '../types.js';
|
|
1
|
+
import type { RenderDomNode, SourceEntity } from '../types.js';
|
|
2
2
|
import type { AssetIndex, NavigationDocument, PageEntity, ComponentEntity, StyleConfig } from '../api/objects.js';
|
|
3
|
+
/**
|
|
4
|
+
* The text 3-way's base for one file (A12): the server's Source text when the
|
|
5
|
+
* server holds one (`onServer`), else the file's text as the last sync left
|
|
6
|
+
* it. A file that differs from it was edited locally since.
|
|
7
|
+
*/
|
|
8
|
+
export interface BaseSource extends SourceEntity {
|
|
9
|
+
onServer: boolean;
|
|
10
|
+
}
|
|
3
11
|
export interface BaseSnapshot {
|
|
4
12
|
pages: Map<string, PageEntity>;
|
|
5
13
|
components: Map<string, ComponentEntity>;
|
|
6
14
|
navigation: NavigationDocument | null;
|
|
7
15
|
style: StyleConfig | null;
|
|
8
16
|
assets: AssetIndex | null;
|
|
17
|
+
/** Per page/component id — every managed file has an entry after a sync. */
|
|
18
|
+
sources: Map<string, BaseSource>;
|
|
9
19
|
}
|
|
10
20
|
export declare class BaseStore {
|
|
11
21
|
private readonly root;
|
|
@@ -22,6 +22,7 @@ export class BaseStore {
|
|
|
22
22
|
navigation: null,
|
|
23
23
|
style: null,
|
|
24
24
|
assets: null,
|
|
25
|
+
sources: new Map(),
|
|
25
26
|
};
|
|
26
27
|
if (!this.exists())
|
|
27
28
|
return snapshot;
|
|
@@ -39,6 +40,13 @@ export class BaseStore {
|
|
|
39
40
|
snapshot.components.set(cmp.id, cmp);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
43
|
+
const sourcesDir = join(this.dir, 'sources');
|
|
44
|
+
if (existsSync(sourcesDir)) {
|
|
45
|
+
for (const file of readdirSync(sourcesDir).filter((f) => f.endsWith('.json'))) {
|
|
46
|
+
const source = JSON.parse(readFileSync(join(sourcesDir, file), 'utf8'));
|
|
47
|
+
snapshot.sources.set(source.of, source);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
42
50
|
for (const key of ['navigation', 'style', 'assets']) {
|
|
43
51
|
const path = join(this.dir, `${key}.json`);
|
|
44
52
|
if (existsSync(path)) {
|
|
@@ -80,6 +88,11 @@ export class BaseStore {
|
|
|
80
88
|
for (const cmp of snapshot.components.values()) {
|
|
81
89
|
writeFileSync(join(tmp, 'components', `${cmp.id}.json`), JSON.stringify(cmp, null, 2) + '\n');
|
|
82
90
|
}
|
|
91
|
+
if (snapshot.sources.size > 0)
|
|
92
|
+
mkdirSync(join(tmp, 'sources'), { recursive: true });
|
|
93
|
+
for (const source of snapshot.sources.values()) {
|
|
94
|
+
writeFileSync(join(tmp, 'sources', `${source.of}.json`), JSON.stringify(source, null, 2) + '\n');
|
|
95
|
+
}
|
|
83
96
|
for (const key of ['navigation', 'style', 'assets']) {
|
|
84
97
|
const value = snapshot[key];
|
|
85
98
|
if (value !== null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseStore.js","sourceRoot":"","sources":["../../src/project/baseStore.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,oDAAoD;AAEpD,OAAO,EACL,SAAS,EACT,WAAW,EACX,YAAY,EACZ,UAAU,EACV,MAAM,EACN,aAAa,EACb,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAUjC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"baseStore.js","sourceRoot":"","sources":["../../src/project/baseStore.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,oDAAoD;AAEpD,OAAO,EACL,SAAS,EACT,WAAW,EACX,YAAY,EACZ,UAAU,EACV,MAAM,EACN,aAAa,EACb,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAUjC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAqBzC,MAAM,OAAO,SAAS;IACS;IAA7B,YAA6B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;IAE7C,IAAY,GAAG;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM;QACJ,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO;QACL,MAAM,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GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JpatchClient } from '../api/client.js';
|
|
2
2
|
import { type SyncReport } from '../ui/report.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type RenderDomNode } from '../types.js';
|
|
4
4
|
export interface SyncEngineInput {
|
|
5
5
|
root: string;
|
|
6
6
|
client: JpatchClient;
|