@plaidev/karte-action-sdk 1.1.102-27903378.680d283c → 1.1.102-27907506.fdeccea7
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/hydrate/index.es.js +14 -5
- package/dist/index.es.js +13 -4
- package/package.json +1 -1
package/dist/hydrate/index.es.js
CHANGED
@@ -214,13 +214,16 @@ function setActionSetting(setting) {
|
|
214
214
|
actionSetting.update(current => {
|
215
215
|
return { ...current, ...setting };
|
216
216
|
});
|
217
|
-
|
217
|
+
const current = getActionSetting();
|
218
|
+
setStopped(!current.autoStart);
|
219
|
+
return current;
|
218
220
|
}
|
219
221
|
/**
|
220
222
|
* {@link resetActionSetting} function to reset action setting
|
221
223
|
*/
|
222
224
|
function resetActionSetting() {
|
223
225
|
actionSetting.set({ autoStart: true });
|
226
|
+
setStopped();
|
224
227
|
}
|
225
228
|
/**
|
226
229
|
* Store to read KARTE system config
|
@@ -425,7 +428,9 @@ function isStopped() {
|
|
425
428
|
* {@link setStopped} function to set if action is stopped.
|
426
429
|
*/
|
427
430
|
function setStopped(on) {
|
428
|
-
|
431
|
+
{
|
432
|
+
stopped.set(false);
|
433
|
+
}
|
429
434
|
}
|
430
435
|
/**
|
431
436
|
* Store to handle custom variables
|
@@ -470,13 +475,16 @@ const handleState = (event) => {
|
|
470
475
|
}
|
471
476
|
};
|
472
477
|
const initialize = (setting) => {
|
473
|
-
|
478
|
+
const newSetting = setActionSetting(setting);
|
479
|
+
if (newSetting.initialState) {
|
474
480
|
const force = true;
|
475
481
|
setState$1(setting?.initialState, force);
|
476
482
|
}
|
483
|
+
if (newSetting.autoStart) {
|
484
|
+
setStopped(!newSetting.autoStart);
|
485
|
+
}
|
477
486
|
setOpened(true);
|
478
487
|
setClosed(false); // deprecated
|
479
|
-
setActionSetting(setting);
|
480
488
|
return () => finalize();
|
481
489
|
};
|
482
490
|
const finalize = () => {
|
@@ -612,7 +620,7 @@ function hashCode(s) {
|
|
612
620
|
* @param {boolean} on
|
613
621
|
*/
|
614
622
|
const setAutoStart = (on = true) => {
|
615
|
-
setStopped(
|
623
|
+
setStopped();
|
616
624
|
};
|
617
625
|
|
618
626
|
const PropTypes = [
|
@@ -863,6 +871,7 @@ function create(App, options = {
|
|
863
871
|
shortenId: data.shorten_id || null,
|
864
872
|
campaignId: data.campaign_id || null,
|
865
873
|
});
|
874
|
+
setInternalHandlers({});
|
866
875
|
if (options.onCreate) {
|
867
876
|
onCreate(options.onCreate);
|
868
877
|
}
|
package/dist/index.es.js
CHANGED
@@ -214,13 +214,16 @@ function setActionSetting(setting) {
|
|
214
214
|
actionSetting.update(current => {
|
215
215
|
return { ...current, ...setting };
|
216
216
|
});
|
217
|
-
|
217
|
+
const current = getActionSetting();
|
218
|
+
setStopped(!current.autoStart);
|
219
|
+
return current;
|
218
220
|
}
|
219
221
|
/**
|
220
222
|
* {@link resetActionSetting} function to reset action setting
|
221
223
|
*/
|
222
224
|
function resetActionSetting() {
|
223
225
|
actionSetting.set({ autoStart: true });
|
226
|
+
setStopped(false);
|
224
227
|
}
|
225
228
|
/**
|
226
229
|
* Store to read KARTE system config
|
@@ -425,7 +428,9 @@ function isStopped() {
|
|
425
428
|
* {@link setStopped} function to set if action is stopped.
|
426
429
|
*/
|
427
430
|
function setStopped(on) {
|
428
|
-
|
431
|
+
{
|
432
|
+
stopped.set(on);
|
433
|
+
}
|
429
434
|
}
|
430
435
|
/**
|
431
436
|
* Store to handle custom variables
|
@@ -470,13 +475,16 @@ const handleState = (event) => {
|
|
470
475
|
}
|
471
476
|
};
|
472
477
|
const initialize = (setting) => {
|
473
|
-
|
478
|
+
const newSetting = setActionSetting(setting);
|
479
|
+
if (newSetting.initialState) {
|
474
480
|
const force = true;
|
475
481
|
setState$1(setting?.initialState, force);
|
476
482
|
}
|
483
|
+
if (newSetting.autoStart) {
|
484
|
+
setStopped(!newSetting.autoStart);
|
485
|
+
}
|
477
486
|
setOpened(true);
|
478
487
|
setClosed(false); // deprecated
|
479
|
-
setActionSetting(setting);
|
480
488
|
return () => finalize();
|
481
489
|
};
|
482
490
|
const finalize = () => {
|
@@ -965,6 +973,7 @@ function create(App, options = {
|
|
965
973
|
shortenId: data.shorten_id || null,
|
966
974
|
campaignId: data.campaign_id || null,
|
967
975
|
});
|
976
|
+
setInternalHandlers({});
|
968
977
|
if (options.onCreate) {
|
969
978
|
onCreate(options.onCreate);
|
970
979
|
}
|