@mantou/gem 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/gem.es.js +1832 -1890
  2. package/dist/gem.umd.js +34 -191
  3. package/elements/base/dialog.d.ts +0 -4
  4. package/elements/base/dialog.d.ts.map +1 -1
  5. package/elements/base/dialog.js +0 -4
  6. package/elements/base/dialog.js.map +1 -1
  7. package/elements/base/gesture.d.ts +5 -14
  8. package/elements/base/gesture.d.ts.map +1 -1
  9. package/elements/base/gesture.js +35 -31
  10. package/elements/base/gesture.js.map +1 -1
  11. package/elements/base/link.d.ts +1 -17
  12. package/elements/base/link.d.ts.map +1 -1
  13. package/elements/base/link.js +12 -32
  14. package/elements/base/link.js.map +1 -1
  15. package/elements/base/modal-factory.d.ts +30 -31
  16. package/elements/base/modal-factory.d.ts.map +1 -1
  17. package/elements/base/reflect.d.ts +0 -3
  18. package/elements/base/reflect.d.ts.map +1 -1
  19. package/elements/base/reflect.js +0 -3
  20. package/elements/base/reflect.js.map +1 -1
  21. package/elements/base/route.d.ts +0 -10
  22. package/elements/base/route.d.ts.map +1 -1
  23. package/elements/base/route.js +10 -22
  24. package/elements/base/route.js.map +1 -1
  25. package/elements/base/title.d.ts +0 -5
  26. package/elements/base/title.d.ts.map +1 -1
  27. package/elements/base/title.js +0 -5
  28. package/elements/base/title.js.map +1 -1
  29. package/elements/base/unsafe.d.ts +0 -5
  30. package/elements/base/unsafe.d.ts.map +1 -1
  31. package/elements/base/unsafe.js +2 -8
  32. package/elements/base/unsafe.js.map +1 -1
  33. package/elements/base/use.d.ts +0 -3
  34. package/elements/base/use.d.ts.map +1 -1
  35. package/elements/base/use.js +4 -11
  36. package/elements/base/use.js.map +1 -1
  37. package/helper/react-shim.d.ts +15 -0
  38. package/helper/react-shim.d.ts.map +1 -0
  39. package/helper/react-shim.js +56 -0
  40. package/helper/react-shim.js.map +1 -0
  41. package/helper/theme.d.ts +3 -3
  42. package/helper/theme.d.ts.map +1 -1
  43. package/helper/theme.js +3 -3
  44. package/helper/theme.js.map +1 -1
  45. package/index.d.ts +0 -1
  46. package/index.d.ts.map +1 -1
  47. package/index.js +0 -1
  48. package/index.js.map +1 -1
  49. package/lib/decorators.d.ts +7 -6
  50. package/lib/decorators.d.ts.map +1 -1
  51. package/lib/decorators.js +45 -30
  52. package/lib/decorators.js.map +1 -1
  53. package/lib/directive.d.ts +83 -0
  54. package/lib/directive.d.ts.map +1 -0
  55. package/lib/directive.js +59 -0
  56. package/lib/directive.js.map +1 -0
  57. package/lib/element.d.ts +7 -21
  58. package/lib/element.d.ts.map +1 -1
  59. package/lib/element.js +53 -49
  60. package/lib/element.js.map +1 -1
  61. package/lib/lit-html.d.ts +331 -0
  62. package/lib/lit-html.d.ts.map +1 -0
  63. package/lib/lit-html.js +941 -0
  64. package/lib/lit-html.js.map +1 -0
  65. package/lib/ref.d.ts +1 -0
  66. package/lib/ref.d.ts.map +1 -0
  67. package/lib/ref.js +2 -0
  68. package/lib/ref.js.map +1 -0
  69. package/lib/repeat.d.ts +126 -0
  70. package/lib/repeat.d.ts.map +1 -0
  71. package/lib/repeat.js +533 -0
  72. package/lib/repeat.js.map +1 -0
  73. package/lib/store.d.ts +1 -1
  74. package/lib/store.d.ts.map +1 -1
  75. package/lib/store.js +4 -4
  76. package/lib/store.js.map +1 -1
  77. package/lib/utils.d.ts +1 -4
  78. package/lib/utils.d.ts.map +1 -1
  79. package/lib/utils.js +5 -15
  80. package/lib/utils.js.map +1 -1
  81. package/lib/version.d.ts +1 -1
  82. package/lib/version.d.ts.map +1 -1
  83. package/lib/version.js +2 -1
  84. package/lib/version.js.map +1 -1
  85. package/package.json +6 -7
  86. package/src/elements/base/dialog.ts +0 -4
  87. package/src/elements/base/gesture.ts +31 -32
  88. package/src/elements/base/link.ts +12 -32
  89. package/src/elements/base/reflect.ts +0 -3
  90. package/src/elements/base/route.ts +11 -21
  91. package/src/elements/base/title.ts +0 -5
  92. package/src/elements/base/unsafe.ts +3 -8
  93. package/src/elements/base/use.ts +4 -11
  94. package/src/helper/theme.ts +4 -4
  95. package/src/index.ts +0 -1
  96. package/src/lib/decorators.ts +50 -37
  97. package/src/lib/directive.ts +139 -0
  98. package/src/lib/element.ts +62 -72
  99. package/src/lib/lit-html.ts +1217 -0
  100. package/src/lib/repeat.ts +580 -0
  101. package/src/lib/store.ts +4 -4
  102. package/src/lib/utils.ts +5 -16
  103. package/src/lib/version.ts +2 -1
  104. package/src/test/elements/link.test.ts +1 -2
  105. package/src/test/elements/reflect.test.ts +13 -3
  106. package/src/test/elements/title.test.ts +1 -2
  107. package/src/test/gem-element/advance.test.ts +15 -8
  108. package/src/test/gem-element/basic.test.ts +22 -10
  109. package/src/test/gem-element/decorators.test.ts +6 -9
  110. package/src/test/gem-element/multi.test.ts +20 -11
  111. package/src/test/history.test.ts +2 -2
  112. package/src/test/store.test.ts +3 -3
  113. package/src/test/utils.test.ts +9 -10
  114. package/src/test/utils.ts +22 -0
  115. package/src/lib/directives.ts +0 -6
package/lib/repeat.js ADDED
@@ -0,0 +1,533 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ import { noChange, ChildPart } from './lit-html';
7
+ import { directive, Directive, PartType } from './directive';
8
+ const createMarker = () => document.createComment('');
9
+ /**
10
+ * Inserts a ChildPart into the given container ChildPart's DOM, either at the
11
+ * end of the container ChildPart, or before the optional `refPart`.
12
+ *
13
+ * This does not add the part to the containerPart's committed value. That must
14
+ * be done by callers.
15
+ *
16
+ * @param containerPart Part within which to add the new ChildPart
17
+ * @param refPart Part before which to add the new ChildPart; when omitted the
18
+ * part added to the end of the `containerPart`
19
+ * @param part Part to insert, or undefined to create a new part
20
+ */
21
+ export const insertPart = (containerPart, refPart, part) => {
22
+ const container = containerPart._$startNode.parentNode;
23
+ const refNode = refPart === undefined ? containerPart._$endNode : refPart._$startNode;
24
+ if (part === undefined) {
25
+ const startNode = container.insertBefore(createMarker(), refNode);
26
+ const endNode = container.insertBefore(createMarker(), refNode);
27
+ part = new ChildPart(startNode, endNode, containerPart, containerPart.options);
28
+ }
29
+ else {
30
+ const endNode = part._$endNode.nextSibling;
31
+ const oldParent = part._$parent;
32
+ const parentChanged = oldParent !== containerPart;
33
+ if (parentChanged) {
34
+ part._$reparentDisconnectables?.(containerPart);
35
+ // Note that although `_$reparentDisconnectables` updates the part's
36
+ // `_$parent` reference after unlinking from its current parent, that
37
+ // method only exists if Disconnectables are present, so we need to
38
+ // unconditionally set it here
39
+ part._$parent = containerPart;
40
+ // Since the _$isConnected getter is somewhat costly, only
41
+ // read it once we know the subtree has directives that need
42
+ // to be notified
43
+ let newConnectionState;
44
+ if (part._$notifyConnectionChanged !== undefined &&
45
+ (newConnectionState = containerPart._$isConnected) !== oldParent._$isConnected) {
46
+ part._$notifyConnectionChanged(newConnectionState);
47
+ }
48
+ }
49
+ if (endNode !== refNode || parentChanged) {
50
+ let start = part._$startNode;
51
+ while (start !== endNode) {
52
+ const n = start.nextSibling;
53
+ container.insertBefore(start, refNode);
54
+ start = n;
55
+ }
56
+ }
57
+ }
58
+ return part;
59
+ };
60
+ /**
61
+ * Sets the value of a Part.
62
+ *
63
+ * Note that this should only be used to set/update the value of user-created
64
+ * parts (i.e. those created using `insertPart`); it should not be used
65
+ * by directives to set the value of the directive's container part. Directives
66
+ * should return a value from `update`/`render` to update their part state.
67
+ *
68
+ * For directives that require setting their part value asynchronously, they
69
+ * should extend `AsyncDirective` and call `this.setValue()`.
70
+ *
71
+ * @param part Part to set
72
+ * @param value Value to set
73
+ * @param index For `AttributePart`s, the index to set
74
+ * @param directiveParent Used internally; should not be set by user
75
+ */
76
+ export const setChildPartValue = (part, value, directiveParent = part) => {
77
+ part._$setValue(value, directiveParent);
78
+ return part;
79
+ };
80
+ // A sentinel value that can never appear as a part value except when set by
81
+ // live(). Used to force a dirty-check to fail and cause a re-render.
82
+ const RESET_VALUE = {};
83
+ /**
84
+ * Sets the committed value of a ChildPart directly without triggering the
85
+ * commit stage of the part.
86
+ *
87
+ * This is useful in cases where a directive needs to update the part such
88
+ * that the next update detects a value change or not. When value is omitted,
89
+ * the next update will be guaranteed to be detected as a change.
90
+ *
91
+ * @param part
92
+ * @param value
93
+ */
94
+ export const setCommittedValue = (part, value = RESET_VALUE) => (part._$committedValue = value);
95
+ /**
96
+ * Returns the committed value of a ChildPart.
97
+ *
98
+ * The committed value is used for change detection and efficient updates of
99
+ * the part. It can differ from the value set by the template or directive in
100
+ * cases where the template value is transformed before being committed.
101
+ *
102
+ * - `TemplateResult`s are committed as a `TemplateInstance`
103
+ * - Iterables are committed as `Array<ChildPart>`
104
+ * - All other types are committed as the template value or value returned or
105
+ * set by a directive.
106
+ *
107
+ * @param part
108
+ */
109
+ export const getCommittedValue = (part) => part._$committedValue;
110
+ /**
111
+ * Removes a ChildPart from the DOM, including any of its content.
112
+ *
113
+ * @param part The Part to remove
114
+ */
115
+ export const removePart = (part) => {
116
+ part._$notifyConnectionChanged?.(false, true);
117
+ let start = part._$startNode;
118
+ const end = part._$endNode.nextSibling;
119
+ while (start !== end) {
120
+ const n = start.nextSibling;
121
+ start.remove();
122
+ start = n;
123
+ }
124
+ };
125
+ export const clearPart = (part) => {
126
+ part._$clear();
127
+ };
128
+ // Helper for generating a map of array item to its index over a subset
129
+ // of an array (used to lazily generate `newKeyToIndexMap` and
130
+ // `oldKeyToIndexMap`)
131
+ const generateMap = (list, start, end) => {
132
+ const map = new Map();
133
+ for (let i = start; i <= end; i++) {
134
+ map.set(list[i], i);
135
+ }
136
+ return map;
137
+ };
138
+ class RepeatDirective extends Directive {
139
+ _itemKeys;
140
+ constructor(partInfo) {
141
+ super(partInfo);
142
+ if (partInfo.type !== PartType.CHILD) {
143
+ throw new Error('repeat() can only be used in text expressions');
144
+ }
145
+ }
146
+ _getValuesAndKeys(items, keyFnOrTemplate, template) {
147
+ let keyFn;
148
+ if (template === undefined) {
149
+ template = keyFnOrTemplate;
150
+ }
151
+ else if (keyFnOrTemplate !== undefined) {
152
+ keyFn = keyFnOrTemplate;
153
+ }
154
+ const keys = [];
155
+ const values = [];
156
+ let index = 0;
157
+ for (const item of items) {
158
+ keys[index] = keyFn ? keyFn(item, index) : index;
159
+ values[index] = template(item, index);
160
+ index++;
161
+ }
162
+ return {
163
+ values,
164
+ keys,
165
+ };
166
+ }
167
+ render(items, keyFnOrTemplate, template) {
168
+ return this._getValuesAndKeys(items, keyFnOrTemplate, template).values;
169
+ }
170
+ update(containerPart, [items, keyFnOrTemplate, template]) {
171
+ // Old part & key lists are retrieved from the last update (which may
172
+ // be primed by hydration)
173
+ const oldParts = getCommittedValue(containerPart);
174
+ const { values: newValues, keys: newKeys } = this._getValuesAndKeys(items, keyFnOrTemplate, template);
175
+ // We check that oldParts, the committed value, is an Array as an
176
+ // indicator that the previous value came from a repeat() call. If
177
+ // oldParts is not an Array then this is the first render and we return
178
+ // an array for lit-html's array handling to render, and remember the
179
+ // keys.
180
+ if (!Array.isArray(oldParts)) {
181
+ this._itemKeys = newKeys;
182
+ return newValues;
183
+ }
184
+ // In SSR hydration it's possible for oldParts to be an array but for us
185
+ // to not have item keys because the update() hasn't run yet. We set the
186
+ // keys to an empty array. This will cause all oldKey/newKey comparisons
187
+ // to fail and execution to fall to the last nested brach below which
188
+ // reuses the oldPart.
189
+ const oldKeys = (this._itemKeys ??= []);
190
+ // New part list will be built up as we go (either reused from
191
+ // old parts or created for new keys in this update). This is
192
+ // saved in the above cache at the end of the update.
193
+ const newParts = [];
194
+ // Maps from key to index for current and previous update; these
195
+ // are generated lazily only when needed as a performance
196
+ // optimization, since they are only required for multiple
197
+ // non-contiguous changes in the list, which are less common.
198
+ let newKeyToIndexMap;
199
+ let oldKeyToIndexMap;
200
+ // Head and tail pointers to old parts and new values
201
+ let oldHead = 0;
202
+ let oldTail = oldParts.length - 1;
203
+ let newHead = 0;
204
+ let newTail = newValues.length - 1;
205
+ // Overview of O(n) reconciliation algorithm (general approach
206
+ // based on ideas found in ivi, vue, snabbdom, etc.):
207
+ //
208
+ // * We start with the list of old parts and new values (and
209
+ // arrays of their respective keys), head/tail pointers into
210
+ // each, and we build up the new list of parts by updating
211
+ // (and when needed, moving) old parts or creating new ones.
212
+ // The initial scenario might look like this (for brevity of
213
+ // the diagrams, the numbers in the array reflect keys
214
+ // associated with the old parts or new values, although keys
215
+ // and parts/values are actually stored in parallel arrays
216
+ // indexed using the same head/tail pointers):
217
+ //
218
+ // oldHead v v oldTail
219
+ // oldKeys: [0, 1, 2, 3, 4, 5, 6]
220
+ // newParts: [ , , , , , , ]
221
+ // newKeys: [0, 2, 1, 4, 3, 7, 6] <- reflects the user's new
222
+ // item order
223
+ // newHead ^ ^ newTail
224
+ //
225
+ // * Iterate old & new lists from both sides, updating,
226
+ // swapping, or removing parts at the head/tail locations
227
+ // until neither head nor tail can move.
228
+ //
229
+ // * Example below: keys at head pointers match, so update old
230
+ // part 0 in-place (no need to move it) and record part 0 in
231
+ // the `newParts` list. The last thing we do is advance the
232
+ // `oldHead` and `newHead` pointers (will be reflected in the
233
+ // next diagram).
234
+ //
235
+ // oldHead v v oldTail
236
+ // oldKeys: [0, 1, 2, 3, 4, 5, 6]
237
+ // newParts: [0, , , , , , ] <- heads matched: update 0
238
+ // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldHead
239
+ // & newHead
240
+ // newHead ^ ^ newTail
241
+ //
242
+ // * Example below: head pointers don't match, but tail
243
+ // pointers do, so update part 6 in place (no need to move
244
+ // it), and record part 6 in the `newParts` list. Last,
245
+ // advance the `oldTail` and `oldHead` pointers.
246
+ //
247
+ // oldHead v v oldTail
248
+ // oldKeys: [0, 1, 2, 3, 4, 5, 6]
249
+ // newParts: [0, , , , , , 6] <- tails matched: update 6
250
+ // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldTail
251
+ // & newTail
252
+ // newHead ^ ^ newTail
253
+ //
254
+ // * If neither head nor tail match; next check if one of the
255
+ // old head/tail items was removed. We first need to generate
256
+ // the reverse map of new keys to index (`newKeyToIndexMap`),
257
+ // which is done once lazily as a performance optimization,
258
+ // since we only hit this case if multiple non-contiguous
259
+ // changes were made. Note that for contiguous removal
260
+ // anywhere in the list, the head and tails would advance
261
+ // from either end and pass each other before we get to this
262
+ // case and removals would be handled in the final while loop
263
+ // without needing to generate the map.
264
+ //
265
+ // * Example below: The key at `oldTail` was removed (no longer
266
+ // in the `newKeyToIndexMap`), so remove that part from the
267
+ // DOM and advance just the `oldTail` pointer.
268
+ //
269
+ // oldHead v v oldTail
270
+ // oldKeys: [0, 1, 2, 3, 4, 5, 6]
271
+ // newParts: [0, , , , , , 6] <- 5 not in new map: remove
272
+ // newKeys: [0, 2, 1, 4, 3, 7, 6] 5 and advance oldTail
273
+ // newHead ^ ^ newTail
274
+ //
275
+ // * Once head and tail cannot move, any mismatches are due to
276
+ // either new or moved items; if a new key is in the previous
277
+ // "old key to old index" map, move the old part to the new
278
+ // location, otherwise create and insert a new part. Note
279
+ // that when moving an old part we null its position in the
280
+ // oldParts array if it lies between the head and tail so we
281
+ // know to skip it when the pointers get there.
282
+ //
283
+ // * Example below: neither head nor tail match, and neither
284
+ // were removed; so find the `newHead` key in the
285
+ // `oldKeyToIndexMap`, and move that old part's DOM into the
286
+ // next head position (before `oldParts[oldHead]`). Last,
287
+ // null the part in the `oldPart` array since it was
288
+ // somewhere in the remaining oldParts still to be scanned
289
+ // (between the head and tail pointers) so that we know to
290
+ // skip that old part on future iterations.
291
+ //
292
+ // oldHead v v oldTail
293
+ // oldKeys: [0, 1, -, 3, 4, 5, 6]
294
+ // newParts: [0, 2, , , , , 6] <- stuck: update & move 2
295
+ // newKeys: [0, 2, 1, 4, 3, 7, 6] into place and advance
296
+ // newHead
297
+ // newHead ^ ^ newTail
298
+ //
299
+ // * Note that for moves/insertions like the one above, a part
300
+ // inserted at the head pointer is inserted before the
301
+ // current `oldParts[oldHead]`, and a part inserted at the
302
+ // tail pointer is inserted before `newParts[newTail+1]`. The
303
+ // seeming asymmetry lies in the fact that new parts are
304
+ // moved into place outside in, so to the right of the head
305
+ // pointer are old parts, and to the right of the tail
306
+ // pointer are new parts.
307
+ //
308
+ // * We always restart back from the top of the algorithm,
309
+ // allowing matching and simple updates in place to
310
+ // continue...
311
+ //
312
+ // * Example below: the head pointers once again match, so
313
+ // simply update part 1 and record it in the `newParts`
314
+ // array. Last, advance both head pointers.
315
+ //
316
+ // oldHead v v oldTail
317
+ // oldKeys: [0, 1, -, 3, 4, 5, 6]
318
+ // newParts: [0, 2, 1, , , , 6] <- heads matched: update 1
319
+ // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldHead
320
+ // & newHead
321
+ // newHead ^ ^ newTail
322
+ //
323
+ // * As mentioned above, items that were moved as a result of
324
+ // being stuck (the final else clause in the code below) are
325
+ // marked with null, so we always advance old pointers over
326
+ // these so we're comparing the next actual old value on
327
+ // either end.
328
+ //
329
+ // * Example below: `oldHead` is null (already placed in
330
+ // newParts), so advance `oldHead`.
331
+ //
332
+ // oldHead v v oldTail
333
+ // oldKeys: [0, 1, -, 3, 4, 5, 6] <- old head already used:
334
+ // newParts: [0, 2, 1, , , , 6] advance oldHead
335
+ // newKeys: [0, 2, 1, 4, 3, 7, 6]
336
+ // newHead ^ ^ newTail
337
+ //
338
+ // * Note it's not critical to mark old parts as null when they
339
+ // are moved from head to tail or tail to head, since they
340
+ // will be outside the pointer range and never visited again.
341
+ //
342
+ // * Example below: Here the old tail key matches the new head
343
+ // key, so the part at the `oldTail` position and move its
344
+ // DOM to the new head position (before `oldParts[oldHead]`).
345
+ // Last, advance `oldTail` and `newHead` pointers.
346
+ //
347
+ // oldHead v v oldTail
348
+ // oldKeys: [0, 1, -, 3, 4, 5, 6]
349
+ // newParts: [0, 2, 1, 4, , , 6] <- old tail matches new
350
+ // newKeys: [0, 2, 1, 4, 3, 7, 6] head: update & move 4,
351
+ // advance oldTail & newHead
352
+ // newHead ^ ^ newTail
353
+ //
354
+ // * Example below: Old and new head keys match, so update the
355
+ // old head part in place, and advance the `oldHead` and
356
+ // `newHead` pointers.
357
+ //
358
+ // oldHead v oldTail
359
+ // oldKeys: [0, 1, -, 3, 4, 5, 6]
360
+ // newParts: [0, 2, 1, 4, 3, ,6] <- heads match: update 3
361
+ // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance oldHead &
362
+ // newHead
363
+ // newHead ^ ^ newTail
364
+ //
365
+ // * Once the new or old pointers move past each other then all
366
+ // we have left is additions (if old list exhausted) or
367
+ // removals (if new list exhausted). Those are handled in the
368
+ // final while loops at the end.
369
+ //
370
+ // * Example below: `oldHead` exceeded `oldTail`, so we're done
371
+ // with the main loop. Create the remaining part and insert
372
+ // it at the new head position, and the update is complete.
373
+ //
374
+ // (oldHead > oldTail)
375
+ // oldKeys: [0, 1, -, 3, 4, 5, 6]
376
+ // newParts: [0, 2, 1, 4, 3, 7 ,6] <- create and insert 7
377
+ // newKeys: [0, 2, 1, 4, 3, 7, 6]
378
+ // newHead ^ newTail
379
+ //
380
+ // * Note that the order of the if/else clauses is not
381
+ // important to the algorithm, as long as the null checks
382
+ // come first (to ensure we're always working on valid old
383
+ // parts) and that the final else clause comes last (since
384
+ // that's where the expensive moves occur). The order of
385
+ // remaining clauses is just a simple guess at which cases
386
+ // will be most common.
387
+ //
388
+ // * Note, we could calculate the longest
389
+ // increasing subsequence (LIS) of old items in new position,
390
+ // and only move those not in the LIS set. However that costs
391
+ // O(nlogn) time and adds a bit more code, and only helps
392
+ // make rare types of mutations require fewer moves. The
393
+ // above handles removes, adds, reversal, swaps, and single
394
+ // moves of contiguous items in linear time, in the minimum
395
+ // number of moves. As the number of multiple moves where LIS
396
+ // might help approaches a random shuffle, the LIS
397
+ // optimization becomes less helpful, so it seems not worth
398
+ // the code at this point. Could reconsider if a compelling
399
+ // case arises.
400
+ while (oldHead <= oldTail && newHead <= newTail) {
401
+ if (oldParts[oldHead] === null) {
402
+ // `null` means old part at head has already been used
403
+ // below; skip
404
+ oldHead++;
405
+ }
406
+ else if (oldParts[oldTail] === null) {
407
+ // `null` means old part at tail has already been used
408
+ // below; skip
409
+ oldTail--;
410
+ }
411
+ else if (oldKeys[oldHead] === newKeys[newHead]) {
412
+ // Old head matches new head; update in place
413
+ newParts[newHead] = setChildPartValue(oldParts[oldHead], newValues[newHead]);
414
+ oldHead++;
415
+ newHead++;
416
+ }
417
+ else if (oldKeys[oldTail] === newKeys[newTail]) {
418
+ // Old tail matches new tail; update in place
419
+ newParts[newTail] = setChildPartValue(oldParts[oldTail], newValues[newTail]);
420
+ oldTail--;
421
+ newTail--;
422
+ }
423
+ else if (oldKeys[oldHead] === newKeys[newTail]) {
424
+ // Old head matches new tail; update and move to new tail
425
+ newParts[newTail] = setChildPartValue(oldParts[oldHead], newValues[newTail]);
426
+ insertPart(containerPart, newParts[newTail + 1], oldParts[oldHead]);
427
+ oldHead++;
428
+ newTail--;
429
+ }
430
+ else if (oldKeys[oldTail] === newKeys[newHead]) {
431
+ // Old tail matches new head; update and move to new head
432
+ newParts[newHead] = setChildPartValue(oldParts[oldTail], newValues[newHead]);
433
+ insertPart(containerPart, oldParts[oldHead], oldParts[oldTail]);
434
+ oldTail--;
435
+ newHead++;
436
+ }
437
+ else {
438
+ if (newKeyToIndexMap === undefined) {
439
+ // Lazily generate key-to-index maps, used for removals &
440
+ // moves below
441
+ newKeyToIndexMap = generateMap(newKeys, newHead, newTail);
442
+ oldKeyToIndexMap = generateMap(oldKeys, oldHead, oldTail);
443
+ }
444
+ if (!newKeyToIndexMap.has(oldKeys[oldHead])) {
445
+ // Old head is no longer in new list; remove
446
+ removePart(oldParts[oldHead]);
447
+ oldHead++;
448
+ }
449
+ else if (!newKeyToIndexMap.has(oldKeys[oldTail])) {
450
+ // Old tail is no longer in new list; remove
451
+ removePart(oldParts[oldTail]);
452
+ oldTail--;
453
+ }
454
+ else {
455
+ // Any mismatches at this point are due to additions or
456
+ // moves; see if we have an old part we can reuse and move
457
+ // into place
458
+ const oldIndex = oldKeyToIndexMap.get(newKeys[newHead]);
459
+ const oldPart = oldIndex !== undefined ? oldParts[oldIndex] : null;
460
+ if (oldPart === null) {
461
+ // No old part for this value; create a new one and
462
+ // insert it
463
+ const newPart = insertPart(containerPart, oldParts[oldHead]);
464
+ setChildPartValue(newPart, newValues[newHead]);
465
+ newParts[newHead] = newPart;
466
+ }
467
+ else {
468
+ // Reuse old part
469
+ newParts[newHead] = setChildPartValue(oldPart, newValues[newHead]);
470
+ insertPart(containerPart, oldParts[oldHead], oldPart);
471
+ // This marks the old part as having been used, so that
472
+ // it will be skipped in the first two checks above
473
+ oldParts[oldIndex] = null;
474
+ }
475
+ newHead++;
476
+ }
477
+ }
478
+ }
479
+ // Add parts for any remaining new values
480
+ while (newHead <= newTail) {
481
+ // For all remaining additions, we insert before last new
482
+ // tail, since old pointers are no longer valid
483
+ const newPart = insertPart(containerPart, newParts[newTail + 1]);
484
+ setChildPartValue(newPart, newValues[newHead]);
485
+ newParts[newHead++] = newPart;
486
+ }
487
+ // Remove any remaining unused old parts
488
+ while (oldHead <= oldTail) {
489
+ const oldPart = oldParts[oldHead++];
490
+ if (oldPart !== null) {
491
+ removePart(oldPart);
492
+ }
493
+ }
494
+ // Save order of new parts for next round
495
+ this._itemKeys = newKeys;
496
+ // Directly set part value, bypassing it's dirty-checking
497
+ setCommittedValue(containerPart, newParts);
498
+ return noChange;
499
+ }
500
+ }
501
+ /**
502
+ * A directive that repeats a series of values (usually `TemplateResults`)
503
+ * generated from an iterable, and updates those items efficiently when the
504
+ * iterable changes based on user-provided `keys` associated with each item.
505
+ *
506
+ * Note that if a `keyFn` is provided, strict key-to-DOM mapping is maintained,
507
+ * meaning previous DOM for a given key is moved into the new position if
508
+ * needed, and DOM will never be reused with values for different keys (new DOM
509
+ * will always be created for new keys). This is generally the most efficient
510
+ * way to use `repeat` since it performs minimum unnecessary work for insertions
511
+ * and removals.
512
+ *
513
+ * The `keyFn` takes two parameters, the item and its index, and returns a unique key value.
514
+ *
515
+ * ```js
516
+ * html`
517
+ * <ol>
518
+ * ${repeat(this.items, (item) => item.id, (item, index) => {
519
+ * return html`<li>${index}: ${item.name}</li>`;
520
+ * })}
521
+ * </ol>
522
+ * `
523
+ * ```
524
+ *
525
+ * **Important**: If providing a `keyFn`, keys *must* be unique for all items in a
526
+ * given call to `repeat`. The behavior when two or more items have the same key
527
+ * is undefined.
528
+ *
529
+ * If no `keyFn` is provided, this directive will perform similar to mapping
530
+ * items to values, and DOM will be reused against potentially different items.
531
+ */
532
+ export const repeat = directive(RepeatDirective);
533
+ //# sourceMappingURL=repeat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repeat.js","sourceRoot":"","sources":["../src/lib/repeat.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAM7D,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;AAEtD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,aAAwB,EAAE,OAAmB,EAAE,IAAgB,EAAa,EAAE;IACvG,MAAM,SAAS,GAAG,aAAa,CAAC,WAAW,CAAC,UAAW,CAAC;IAExD,MAAM,OAAO,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IAEtF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;QAClE,MAAM,OAAO,GAAG,SAAS,CAAC,YAAY,CAAC,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;QAChE,IAAI,GAAG,IAAI,SAAS,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AAO,CAAC,CAAC,CAAC;YAC/C,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;QAChC,CAAC;QACD,wCAAwC;QACxC,OAAO,OAAO,IAAI,OAAO,EAAE,CAAC;YAC1B,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;YACpC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACrB,UAAU,CAAC,OAAO,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;QAED,yCAAyC;QACzC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC;QACzB,yDAAyD;QACzD,iBAAiB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QAC3C,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAQD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC,eAAe,CAAsB,CAAC"}
package/lib/store.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createUpdater } from './utils';
2
2
  export type Store<T = any> = ReturnType<typeof createUpdater<T>>;
3
- export declare const StoreListenerMap: WeakMap<any, Set<() => void>>;
3
+ export declare const _StoreListenerMap: WeakMap<any, Set<() => void>>;
4
4
  export declare function createStore<T = any>(originStore: T): ((value?: Partial<T>) => void) & T;
5
5
  export declare function connect(store: Store<any>, func: () => void): () => boolean | undefined;
6
6
  //# sourceMappingURL=store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/lib/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;AAEtD,MAAM,MAAM,KAAK,CAAC,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAEjE,eAAO,MAAM,gBAAgB,yBAAqC,IAAI,EAAI,CAAC;AAE3E,wBAAgB,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,WAAW,EAAE,CAAC,aACC,OAAO,CAAC,CAAC,CAAC,eAM7D;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,IAAI,6BAI1D"}
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/lib/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;AAEtD,MAAM,MAAM,KAAK,CAAC,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAEjE,eAAO,MAAM,iBAAiB,yBAAqC,IAAI,EAAI,CAAC;AAE5E,wBAAgB,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,WAAW,EAAE,CAAC,aACC,OAAO,CAAC,CAAC,CAAC,eAM7D;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,IAAI,6BAI1D"}
package/lib/store.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { addMicrotask, createUpdater } from './utils';
2
- export const StoreListenerMap = new WeakMap();
2
+ export const _StoreListenerMap = new WeakMap();
3
3
  export function createStore(originStore) {
4
4
  const store = createUpdater(originStore, (value) => {
5
5
  Object.assign(store, value);
6
- StoreListenerMap.get(store)?.forEach((func) => addMicrotask(func));
6
+ _StoreListenerMap.get(store)?.forEach((func) => addMicrotask(func));
7
7
  });
8
- StoreListenerMap.set(store, new Set());
8
+ _StoreListenerMap.set(store, new Set());
9
9
  return store;
10
10
  }
11
11
  export function connect(store, func) {
12
- const listeners = StoreListenerMap.get(store);
12
+ const listeners = _StoreListenerMap.get(store);
13
13
  listeners?.add(func);
14
14
  return () => listeners?.delete(func);
15
15
  }
package/lib/store.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"store.js","sourceRoot":"","sources":["../src/lib/store.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AC,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IACH,iBAAiB,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,GAAG,EAAc,CAAC,CAAC;IACpD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,KAAiB,EAAE,IAAgB;IACzD,MAAM,SAAS,GAAG,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/C,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IACrB,OAAO,GAAG,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC"}
package/lib/utils.d.ts CHANGED
@@ -43,11 +43,8 @@ export declare class QueryString extends URLSearchParams {
43
43
  * 不同于 lit-html 的 `html` 模版函数,写 attribute 时必须手动写引号并自行进行 html 编码
44
44
  */
45
45
  export declare function raw(arr: TemplateStringsArray, ...args: any[]): string;
46
- export declare const css: typeof raw;
46
+ export declare const styled: typeof raw;
47
47
  export declare function randomStr(len?: number): string;
48
- export declare const styled: {
49
- class: typeof raw;
50
- };
51
48
  export declare function camelToKebabCase(str: string): string;
52
49
  export declare function kebabToCamelCase(str: string): string;
53
50
  export declare function cleanObject<T extends Record<string, unknown>>(o: T): T;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/lib/utils.ts"],"names":[],"mappings":"AAGA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,IAAI,QAO5C;AAGD,wBAAgB,aAAa,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,GAOvE,EAAE,GAAG,CAAC,CACvB;AAGD,wBAAgB,gBAAgB,CAAC,WAAW,SAAK,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