@pinegrow/vite-plugin 3.0.0-beta.47 → 3.0.0-beta.48

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 (2) hide show
  1. package/dist/vue-plugin.js +17 -14
  2. package/package.json +1 -1
@@ -43,17 +43,20 @@ export function usePinegrow() {
43
43
  if (
44
44
  value.instance.isMounted &&
45
45
  !value.instance.isUnmounted &&
46
- value.pgId &&
46
+ value.pgIds &&
47
+ value.pgIds.length &&
47
48
  (!value.rootEl || value.isRootFragment)
48
49
  ) {
49
- if (!pgIds[value.pgId]) {
50
- pgIds[value.pgId] = []
51
- }
52
- if (value.key === undefined || value.key === null) {
53
- pgIds[value.pgId].push(value)
54
- } else {
55
- pgIds[value.pgId].push([value.key, value])
56
- }
50
+ value.pgIds.forEach(pgId => {
51
+ if (!pgIds[pgId]) {
52
+ pgIds[pgId] = []
53
+ }
54
+ if (value.key === undefined || value.key === null) {
55
+ pgIds[pgId].push(value)
56
+ } else {
57
+ pgIds[pgId].push([value.key, value])
58
+ }
59
+ })
57
60
  }
58
61
  }
59
62
  return pgIds
@@ -149,10 +152,10 @@ export function usePinegrow() {
149
152
  // return
150
153
  // }
151
154
 
152
- if (pinegrow.elCache.has(el)) {
153
- // pgId could have been updated
154
- if (pgId) {
155
- pinegrow.elCache.get(el).pgId = pgId
155
+ const prevElCache = pinegrow.elCache.get(el)
156
+ if (prevElCache) {
157
+ if (pgId && !prevElCache.pgIds.includes(pgId)) {
158
+ prevElCache.pgIds.push(pgId)
156
159
  }
157
160
  if (key !== null && key !== undefined) {
158
161
  pinegrow.elCache.get(el).key = key
@@ -246,7 +249,7 @@ export function usePinegrow() {
246
249
  isFragment,
247
250
  firstEl,
248
251
  lastEl,
249
- pgId,
252
+ pgIds: pgId ? [pgId] : [],
250
253
  key,
251
254
  localFile,
252
255
  isIsland,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinegrow/vite-plugin",
3
- "version": "3.0.0-beta.47",
3
+ "version": "3.0.0-beta.48",
4
4
  "description": "Pinegrow Vite Plugin",
5
5
  "type": "module",
6
6
  "files": [