@appkit/dek-plugin 0.15.0 → 0.17.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.
- package/dist/index.es.js +5 -3
- package/dist/index.umd.js +5 -3
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -144,7 +144,9 @@ function setState(integrationKey, key, value) {
|
|
|
144
144
|
`api:${integrationKey.toLowerCase()}`,
|
|
145
145
|
JSON.stringify(localData)
|
|
146
146
|
);
|
|
147
|
-
|
|
147
|
+
const ev = new Event("storage");
|
|
148
|
+
ev.key = `api:${integrationKey.toLowerCase()}`;
|
|
149
|
+
window.dispatchEvent(ev);
|
|
148
150
|
}
|
|
149
151
|
function getState(integrationKey, key) {
|
|
150
152
|
const localData = getStateRoot(integrationKey);
|
|
@@ -414,7 +416,7 @@ function usePluginState(api2, key, defaultValue) {
|
|
|
414
416
|
const integrationKey = api2.integrationKey;
|
|
415
417
|
const state = useState(integrationKey);
|
|
416
418
|
let value;
|
|
417
|
-
if (state && state[key]) {
|
|
419
|
+
if (state && state[key] !== void 0) {
|
|
418
420
|
value = state[key];
|
|
419
421
|
} else {
|
|
420
422
|
value = defaultValue;
|
|
@@ -433,7 +435,7 @@ function usePluginStateObject(api2, key, defaultValue = {}) {
|
|
|
433
435
|
const integrationKey = api2.integrationKey;
|
|
434
436
|
const state = useState(integrationKey);
|
|
435
437
|
let value;
|
|
436
|
-
if (state && state[key]) {
|
|
438
|
+
if (state && state[key] !== void 0) {
|
|
437
439
|
value = tryParseJson(state[key], defaultValue);
|
|
438
440
|
} else {
|
|
439
441
|
value = defaultValue;
|
package/dist/index.umd.js
CHANGED
|
@@ -147,7 +147,9 @@ var __publicField = (obj, key, value) => {
|
|
|
147
147
|
`api:${integrationKey.toLowerCase()}`,
|
|
148
148
|
JSON.stringify(localData)
|
|
149
149
|
);
|
|
150
|
-
|
|
150
|
+
const ev = new Event("storage");
|
|
151
|
+
ev.key = `api:${integrationKey.toLowerCase()}`;
|
|
152
|
+
window.dispatchEvent(ev);
|
|
151
153
|
}
|
|
152
154
|
function getState(integrationKey, key) {
|
|
153
155
|
const localData = getStateRoot(integrationKey);
|
|
@@ -417,7 +419,7 @@ var __publicField = (obj, key, value) => {
|
|
|
417
419
|
const integrationKey = api2.integrationKey;
|
|
418
420
|
const state = useState(integrationKey);
|
|
419
421
|
let value;
|
|
420
|
-
if (state && state[key]) {
|
|
422
|
+
if (state && state[key] !== void 0) {
|
|
421
423
|
value = state[key];
|
|
422
424
|
} else {
|
|
423
425
|
value = defaultValue;
|
|
@@ -436,7 +438,7 @@ var __publicField = (obj, key, value) => {
|
|
|
436
438
|
const integrationKey = api2.integrationKey;
|
|
437
439
|
const state = useState(integrationKey);
|
|
438
440
|
let value;
|
|
439
|
-
if (state && state[key]) {
|
|
441
|
+
if (state && state[key] !== void 0) {
|
|
440
442
|
value = tryParseJson(state[key], defaultValue);
|
|
441
443
|
} else {
|
|
442
444
|
value = defaultValue;
|