piral-vue-3 0.15.0-alpha.4122 → 0.15.0-alpha.4284

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/esm/extension.js CHANGED
@@ -7,6 +7,35 @@ export function createExtension(rootName) {
7
7
  render() {
8
8
  return h(rootName);
9
9
  },
10
+ watch: {
11
+ params(newValue, oldValue) {
12
+ if (newValue !== oldValue) {
13
+ const newKeys = Object.keys(newValue);
14
+ const oldKeys = Object.keys(oldValue);
15
+ if (newKeys.length === oldKeys.length) {
16
+ let changed = false;
17
+ for (const key of newKeys) {
18
+ if (!oldKeys.includes(key) || newValue[key] !== oldValue[key]) {
19
+ changed = true;
20
+ break;
21
+ }
22
+ }
23
+ if (!changed) {
24
+ return;
25
+ }
26
+ }
27
+ const ev = new CustomEvent('extension-props-changed', {
28
+ detail: {
29
+ empty: this.empty,
30
+ params: newValue,
31
+ render: this.render,
32
+ name: this.name,
33
+ },
34
+ });
35
+ this.$el.dispatchEvent(ev);
36
+ }
37
+ },
38
+ },
10
39
  mounted() {
11
40
  this.piral.renderHtmlExtension(this.$el, {
12
41
  empty: this.empty,
@@ -1 +1 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,CAAC,EAAE,MAAM,KAAK,CAAC;AAEnC,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,MAAM,aAAa,GAAkC;QACnD,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC;QAC5C,MAAM,EAAE,CAAC,OAAO,CAAC;QACjB,MAAM;YACJ,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC;QACrB,CAAC;QACD,OAAO;YACL,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,EAAE;gBACvC,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB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wBACpD,MAAM,EAAE;4BACN,KAAK,EAAE,IAAI,CAAC,KAAK;4BACjB,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,IAAI,CAAC,MAAM;4BACnB,IAAI,EAAE,IAAI,CAAC,IAAI;yBAChB;qBACF,CAAC,CAAC;oBACH,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;iBAC5B;YACH,CAAC;SACF;QACD,OAAO;YACL,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,EAAE;gBACvC,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAC,CAAC;QACL,CAAC;KACF,CAAC;IAEF,OAAO,aAAa,CAAC;AACvB,CAAC"}
package/lib/extension.js CHANGED
@@ -10,6 +10,35 @@ function createExtension(rootName) {
10
10
  render() {
11
11
  return (0, vue_1.h)(rootName);
12
12
  },
13
+ watch: {
14
+ params(newValue, oldValue) {
15
+ if (newValue !== oldValue) {
16
+ const newKeys = Object.keys(newValue);
17
+ const oldKeys = Object.keys(oldValue);
18
+ if (newKeys.length === oldKeys.length) {
19
+ let changed = false;
20
+ for (const key of newKeys) {
21
+ if (!oldKeys.includes(key) || newValue[key] !== oldValue[key]) {
22
+ changed = true;
23
+ break;
24
+ }
25
+ }
26
+ if (!changed) {
27
+ return;
28
+ }
29
+ }
30
+ const ev = new CustomEvent('extension-props-changed', {
31
+ detail: {
32
+ empty: this.empty,
33
+ params: newValue,
34
+ render: this.render,
35
+ name: this.name,
36
+ },
37
+ });
38
+ this.$el.dispatchEvent(ev);
39
+ }
40
+ },
41
+ },
13
42
  mounted() {
14
43
  this.piral.renderHtmlExtension(this.$el, {
15
44
  empty: this.empty,
@@ -1 +1 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.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AAM,KAAK,OAAO,CAAC,MAAM,EAAE;wBACrC,IAAI,OAAO,GAAG,KAAK,CAAC;wBAEpB,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;4BACzB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,GAAG,CAAC,EAAE;gCAC7D,OAAO,GAAG,IAAI,CAAC;gCACf,MAAM;6BACP;yBACF;wBAED,IAAI,CAAC,OAAO,EAAE;4BACZ,OAAO;yBACR;qBACF;oBAED,MAAM,EAAE,GAAG,IAAI,WAAW,CAAC,yBAAyB,EAAE;wBACpD,MAAM,EAAE;4BACN,KAAK,EAAE,IAAI,CAAC,KAAK;4BACjB,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,IAAI,CAAC,MAAM;4BACnB,IAAI,EAAE,IAAI,CAAC,IAAI;yBAChB;qBACF,CAAC,CAAC;oBACH,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;iBAC5B;YACH,CAAC;SACF;QACD,OAAO;YACL,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,EAAE;gBACvC,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAC,CAAC;QACL,CAAC;KACF,CAAC;IAEF,OAAO,aAAa,CAAC;AACvB,CAAC;AApDD,0CAoDC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piral-vue-3",
3
- "version": "0.15.0-alpha.4122",
3
+ "version": "0.15.0-alpha.4284",
4
4
  "description": "Plugin for integrating Vue@3 components in Piral.",
5
5
  "keywords": [
6
6
  "piral",
@@ -28,11 +28,11 @@
28
28
  "./convert": {
29
29
  "import": "./convert.js"
30
30
  },
31
- "./esm/": {
32
- "import": "./esm/"
31
+ "./esm/*": {
32
+ "import": "./esm/*"
33
33
  },
34
- "./lib/": {
35
- "require": "./lib/"
34
+ "./lib/*": {
35
+ "require": "./lib/*"
36
36
  },
37
37
  "./package.json": "./package.json"
38
38
  },
@@ -61,11 +61,11 @@
61
61
  "test": "echo \"Error: run tests from root\" && exit 1"
62
62
  },
63
63
  "devDependencies": {
64
- "piral-core": "0.15.0-alpha.4122",
64
+ "piral-core": "0.15.0-alpha.4284",
65
65
  "vue": "^3.0.0"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "vue": "^3.0.0"
69
69
  },
70
- "gitHead": "fa0957fe7dedebbbd97a530e518c1a2b7754d475"
70
+ "gitHead": "c48d6a2c320241d04e3c9c4c4edb423345003587"
71
71
  }
package/src/extension.ts CHANGED
@@ -9,6 +9,39 @@ export function createExtension(rootName: string): Component<ExtensionSlotProps>
9
9
  render() {
10
10
  return h(rootName);
11
11
  },
12
+ watch: {
13
+ params(newValue, oldValue) {
14
+ if (newValue !== oldValue) {
15
+ const newKeys = Object.keys(newValue);
16
+ const oldKeys = Object.keys(oldValue);
17
+
18
+ if (newKeys.length === oldKeys.length) {
19
+ let changed = false;
20
+
21
+ for (const key of newKeys) {
22
+ if (!oldKeys.includes(key) || newValue[key] !== oldValue[key]) {
23
+ changed = true;
24
+ break;
25
+ }
26
+ }
27
+
28
+ if (!changed) {
29
+ return;
30
+ }
31
+ }
32
+
33
+ const ev = new CustomEvent('extension-props-changed', {
34
+ detail: {
35
+ empty: this.empty,
36
+ params: newValue,
37
+ render: this.render,
38
+ name: this.name,
39
+ },
40
+ });
41
+ this.$el.dispatchEvent(ev);
42
+ }
43
+ },
44
+ },
12
45
  mounted() {
13
46
  this.piral.renderHtmlExtension(this.$el, {
14
47
  empty: this.empty,