smoothly 0.3.60 → 0.3.62

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.
@@ -784,18 +784,31 @@ class Listenable {
784
784
  constructor() {
785
785
  _Listenable_listeners.set(this, {});
786
786
  }
787
- listen(property, listener) {
787
+ listen(property, listener, options) {
788
788
  var _a, _b;
789
789
  (_b = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.push(listener)) !== null && _b !== void 0 ? _b : (__classPrivateFieldGet(this, _Listenable_listeners, "f")[property] = [listener]);
790
- listener(this[property]);
790
+ if (!(options === null || options === void 0 ? void 0 : options.lazy))
791
+ listener(this[property]);
791
792
  }
792
793
  unlisten(property, listener) {
793
794
  var _a, _b;
794
795
  const index = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.indexOf(listener);
795
796
  index != undefined && index >= 0 && ((_b = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _b === void 0 ? void 0 : _b.splice(index, 1));
796
797
  }
797
- static load(backend, listenable) {
798
- const result = listenable !== null && listenable !== void 0 ? listenable : new Listenable();
798
+ batchListen(listeners, options) {
799
+ for (const key in listeners) {
800
+ const listener = listeners[key];
801
+ listener && this.listen(key, listener, options);
802
+ }
803
+ }
804
+ batchUnlisten(listeners) {
805
+ for (const key in listeners) {
806
+ const listener = listeners[key];
807
+ listener && this.unlisten(key, listener);
808
+ }
809
+ }
810
+ static load(backend) {
811
+ const result = backend.listenable;
799
812
  return Object.defineProperties(result, getProperties(backend));
800
813
  function getProperties(backend) {
801
814
  return Object.fromEntries(Object.entries(Object.assign(Object.assign({}, Object.getOwnPropertyDescriptors(backend)), Object.getOwnPropertyDescriptors(Object.getPrototypeOf(backend)))).map(([name, descriptor]) => [
@@ -819,7 +832,7 @@ class Listenable {
819
832
  }
820
833
  : {
821
834
  get() {
822
- return backend[name].bind(backend);
835
+ return backend[name];
823
836
  },
824
837
  },
825
838
  ]));
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-679a68de.js');
6
- const Listenable = require('./Listenable-fcea5136.js');
6
+ const Listenable = require('./Listenable-dd19f28e.js');
7
7
  const GoogleFont = require('./GoogleFont-6c4f0da1.js');
8
8
  require('./index-8352a4e0.js');
9
9
 
@@ -19,6 +19,13 @@ class ClientIdentifier {
19
19
  }
20
20
  }
21
21
 
22
+ class StateBase {
23
+ constructor(...parameters) {
24
+ this.listenable = new Listenable.Listenable();
25
+ this.client = parameters.length == 1 ? parameters[0] : undefined;
26
+ }
27
+ }
28
+
22
29
  exports.App = index.App;
23
30
  Object.defineProperty(exports, 'Cosmetic', {
24
31
  enumerable: true,
@@ -44,3 +51,4 @@ Object.defineProperty(exports, 'GoogleFont', {
44
51
  }
45
52
  });
46
53
  exports.ClientIdentifier = ClientIdentifier;
54
+ exports.StateBase = StateBase;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-8352a4e0.js');
6
6
  const index$1 = require('./index-679a68de.js');
7
- const Listenable = require('./Listenable-fcea5136.js');
7
+ const Listenable = require('./Listenable-dd19f28e.js');
8
8
  require('./GoogleFont-6c4f0da1.js');
9
9
  const getLanguage = require('./getLanguage-7991c46a.js');
10
10
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-8352a4e0.js');
6
- const Listenable = require('./Listenable-fcea5136.js');
6
+ const Listenable = require('./Listenable-dd19f28e.js');
7
7
  require('./GoogleFont-6c4f0da1.js');
8
8
 
9
9
  const styleCss = ".sc-smoothly-trigger-sink-h{display:block}[hidden].sc-smoothly-trigger-sink-h{display:none}";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-8352a4e0.js');
6
- const Listenable = require('./Listenable-fcea5136.js');
6
+ const Listenable = require('./Listenable-dd19f28e.js');
7
7
  require('./GoogleFont-6c4f0da1.js');
8
8
 
9
9
  const styleCss = ".sc-smoothly-trigger-source-h{display:block}[hidden].sc-smoothly-trigger-source-h{display:none}";
@@ -1,3 +1,3 @@
1
1
  export { App, redirect } from "./components/App";
2
- export { ClientIdentifier, GoogleFont, Icon, Message, Notice, Trigger, Listenable, } from "./model";
2
+ export { ClientIdentifier, GoogleFont, Icon, Message, Notice, Trigger, StateBase, Listenable, } from "./model";
3
3
  export { Cosmetic } from "./utilities";
@@ -10,18 +10,31 @@ export class Listenable {
10
10
  constructor() {
11
11
  _Listenable_listeners.set(this, {});
12
12
  }
13
- listen(property, listener) {
13
+ listen(property, listener, options) {
14
14
  var _a, _b;
15
15
  (_b = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.push(listener)) !== null && _b !== void 0 ? _b : (__classPrivateFieldGet(this, _Listenable_listeners, "f")[property] = [listener]);
16
- listener(this[property]);
16
+ if (!(options === null || options === void 0 ? void 0 : options.lazy))
17
+ listener(this[property]);
17
18
  }
18
19
  unlisten(property, listener) {
19
20
  var _a, _b;
20
21
  const index = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.indexOf(listener);
21
22
  index != undefined && index >= 0 && ((_b = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _b === void 0 ? void 0 : _b.splice(index, 1));
22
23
  }
23
- static load(backend, listenable) {
24
- const result = listenable !== null && listenable !== void 0 ? listenable : new Listenable();
24
+ batchListen(listeners, options) {
25
+ for (const key in listeners) {
26
+ const listener = listeners[key];
27
+ listener && this.listen(key, listener, options);
28
+ }
29
+ }
30
+ batchUnlisten(listeners) {
31
+ for (const key in listeners) {
32
+ const listener = listeners[key];
33
+ listener && this.unlisten(key, listener);
34
+ }
35
+ }
36
+ static load(backend) {
37
+ const result = backend.listenable;
25
38
  return Object.defineProperties(result, getProperties(backend));
26
39
  function getProperties(backend) {
27
40
  return Object.fromEntries(Object.entries(Object.assign(Object.assign({}, Object.getOwnPropertyDescriptors(backend)), Object.getOwnPropertyDescriptors(Object.getPrototypeOf(backend)))).map(([name, descriptor]) => [
@@ -45,7 +58,7 @@ export class Listenable {
45
58
  }
46
59
  : {
47
60
  get() {
48
- return backend[name].bind(backend);
61
+ return backend[name];
49
62
  },
50
63
  },
51
64
  ]));
@@ -0,0 +1,7 @@
1
+ import { Listenable } from "./Listenable";
2
+ export class StateBase {
3
+ constructor(...parameters) {
4
+ this.listenable = new Listenable();
5
+ this.client = parameters.length == 1 ? parameters[0] : undefined;
6
+ }
7
+ }
@@ -5,3 +5,4 @@ export { Message } from "./Message";
5
5
  export { Notice } from "./Notice";
6
6
  export { Trigger } from "./Trigger";
7
7
  export { Listenable } from "./Listenable";
8
+ export { StateBase } from "./StateBase";
@@ -1309,18 +1309,31 @@ class Listenable {
1309
1309
  constructor() {
1310
1310
  _Listenable_listeners.set(this, {});
1311
1311
  }
1312
- listen(property, listener) {
1312
+ listen(property, listener, options) {
1313
1313
  var _a, _b;
1314
1314
  (_b = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.push(listener)) !== null && _b !== void 0 ? _b : (__classPrivateFieldGet(this, _Listenable_listeners, "f")[property] = [listener]);
1315
- listener(this[property]);
1315
+ if (!(options === null || options === void 0 ? void 0 : options.lazy))
1316
+ listener(this[property]);
1316
1317
  }
1317
1318
  unlisten(property, listener) {
1318
1319
  var _a, _b;
1319
1320
  const index = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.indexOf(listener);
1320
1321
  index != undefined && index >= 0 && ((_b = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _b === void 0 ? void 0 : _b.splice(index, 1));
1321
1322
  }
1322
- static load(backend, listenable) {
1323
- const result = listenable !== null && listenable !== void 0 ? listenable : new Listenable();
1323
+ batchListen(listeners, options) {
1324
+ for (const key in listeners) {
1325
+ const listener = listeners[key];
1326
+ listener && this.listen(key, listener, options);
1327
+ }
1328
+ }
1329
+ batchUnlisten(listeners) {
1330
+ for (const key in listeners) {
1331
+ const listener = listeners[key];
1332
+ listener && this.unlisten(key, listener);
1333
+ }
1334
+ }
1335
+ static load(backend) {
1336
+ const result = backend.listenable;
1324
1337
  return Object.defineProperties(result, getProperties(backend));
1325
1338
  function getProperties(backend) {
1326
1339
  return Object.fromEntries(Object.entries(Object.assign(Object.assign({}, Object.getOwnPropertyDescriptors(backend)), Object.getOwnPropertyDescriptors(Object.getPrototypeOf(backend)))).map(([name, descriptor]) => [
@@ -1344,7 +1357,7 @@ class Listenable {
1344
1357
  }
1345
1358
  : {
1346
1359
  get() {
1347
- return backend[name].bind(backend);
1360
+ return backend[name];
1348
1361
  },
1349
1362
  },
1350
1363
  ]));
@@ -1353,6 +1366,13 @@ class Listenable {
1353
1366
  }
1354
1367
  _Listenable_listeners = new WeakMap();
1355
1368
 
1369
+ class StateBase {
1370
+ constructor(...parameters) {
1371
+ this.listenable = new Listenable();
1372
+ this.client = parameters.length == 1 ? parameters[0] : undefined;
1373
+ }
1374
+ }
1375
+
1356
1376
  var Hex;
1357
1377
  (function (Hex) {
1358
1378
  function is(value) {
@@ -24393,4 +24413,4 @@ const defineCustomElements = (opts) => {
24393
24413
  }
24394
24414
  };
24395
24415
 
24396
- export { App, ClientIdentifier, Cosmetic, GoogleFont, Icon, Listenable, Message, Notice, SmoothlyAccordion, SmoothlyAccordionItem, SmoothlyApp, SmoothlyAppDemo, SmoothlyBacktotop, SmoothlyButton, SmoothlyCalendar, SmoothlyCheckbox, SmoothlyCountry, SmoothlyDialog, SmoothlyDialogDemo, SmoothlyDisplay, SmoothlyDisplayAmount, SmoothlyDisplayDateTime, SmoothlyDisplayDemo, SmoothlyFrame, SmoothlyGoogleFont, SmoothlyIcon, SmoothlyIconDemo, SmoothlyInput, SmoothlyInputDate, SmoothlyInputDateRange, SmoothlyInputDemo, SmoothlyInputMonth, SmoothlyItem, SmoothlyMenuOptions, SmoothlyNotification, SmoothlyNotifier, SmoothlyOption, SmoothlyPicker, SmoothlyPopup, SmoothlyQuiet, SmoothlyRadio, SmoothlyRadioButton, SmoothlyRadioButtonItem, SmoothlyRadioGroup, SmoothlyReorder, SmoothlyRoom, SmoothlySelect, SmoothlySelectDemo, SmoothlySelector, SmoothlySkeleton, SmoothlySpinner, SmoothlySubmit, SmoothlySvg, SmoothlyTab, SmoothlyTabSwitch, SmoothlyTable, SmoothlyTableCell, SmoothlyTableDemo, SmoothlyTableExpandableCell, SmoothlyTableExpandableRow, SmoothlyTableHeader, SmoothlyTableRow, SmoothlyTrigger, SmoothlyTriggerSink, SmoothlyTriggerSource, SmoothlyTuple, SmoothlyUrlencoded, Trigger, defineCustomElements, redirect };
24416
+ export { App, ClientIdentifier, Cosmetic, GoogleFont, Icon, Listenable, Message, Notice, SmoothlyAccordion, SmoothlyAccordionItem, SmoothlyApp, SmoothlyAppDemo, SmoothlyBacktotop, SmoothlyButton, SmoothlyCalendar, SmoothlyCheckbox, SmoothlyCountry, SmoothlyDialog, SmoothlyDialogDemo, SmoothlyDisplay, SmoothlyDisplayAmount, SmoothlyDisplayDateTime, SmoothlyDisplayDemo, SmoothlyFrame, SmoothlyGoogleFont, SmoothlyIcon, SmoothlyIconDemo, SmoothlyInput, SmoothlyInputDate, SmoothlyInputDateRange, SmoothlyInputDemo, SmoothlyInputMonth, SmoothlyItem, SmoothlyMenuOptions, SmoothlyNotification, SmoothlyNotifier, SmoothlyOption, SmoothlyPicker, SmoothlyPopup, SmoothlyQuiet, SmoothlyRadio, SmoothlyRadioButton, SmoothlyRadioButtonItem, SmoothlyRadioGroup, SmoothlyReorder, SmoothlyRoom, SmoothlySelect, SmoothlySelectDemo, SmoothlySelector, SmoothlySkeleton, SmoothlySpinner, SmoothlySubmit, SmoothlySvg, SmoothlyTab, SmoothlyTabSwitch, SmoothlyTable, SmoothlyTableCell, SmoothlyTableDemo, SmoothlyTableExpandableCell, SmoothlyTableExpandableRow, SmoothlyTableHeader, SmoothlyTableRow, SmoothlyTrigger, SmoothlyTriggerSink, SmoothlyTriggerSource, SmoothlyTuple, SmoothlyUrlencoded, StateBase, Trigger, defineCustomElements, redirect };
@@ -782,18 +782,31 @@ class Listenable {
782
782
  constructor() {
783
783
  _Listenable_listeners.set(this, {});
784
784
  }
785
- listen(property, listener) {
785
+ listen(property, listener, options) {
786
786
  var _a, _b;
787
787
  (_b = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.push(listener)) !== null && _b !== void 0 ? _b : (__classPrivateFieldGet(this, _Listenable_listeners, "f")[property] = [listener]);
788
- listener(this[property]);
788
+ if (!(options === null || options === void 0 ? void 0 : options.lazy))
789
+ listener(this[property]);
789
790
  }
790
791
  unlisten(property, listener) {
791
792
  var _a, _b;
792
793
  const index = (_a = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _a === void 0 ? void 0 : _a.indexOf(listener);
793
794
  index != undefined && index >= 0 && ((_b = __classPrivateFieldGet(this, _Listenable_listeners, "f")[property]) === null || _b === void 0 ? void 0 : _b.splice(index, 1));
794
795
  }
795
- static load(backend, listenable) {
796
- const result = listenable !== null && listenable !== void 0 ? listenable : new Listenable();
796
+ batchListen(listeners, options) {
797
+ for (const key in listeners) {
798
+ const listener = listeners[key];
799
+ listener && this.listen(key, listener, options);
800
+ }
801
+ }
802
+ batchUnlisten(listeners) {
803
+ for (const key in listeners) {
804
+ const listener = listeners[key];
805
+ listener && this.unlisten(key, listener);
806
+ }
807
+ }
808
+ static load(backend) {
809
+ const result = backend.listenable;
797
810
  return Object.defineProperties(result, getProperties(backend));
798
811
  function getProperties(backend) {
799
812
  return Object.fromEntries(Object.entries(Object.assign(Object.assign({}, Object.getOwnPropertyDescriptors(backend)), Object.getOwnPropertyDescriptors(Object.getPrototypeOf(backend)))).map(([name, descriptor]) => [
@@ -817,7 +830,7 @@ class Listenable {
817
830
  }
818
831
  : {
819
832
  get() {
820
- return backend[name].bind(backend);
833
+ return backend[name];
821
834
  },
822
835
  },
823
836
  ]));
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { A as App, C as Cosmetic, N as Notice, r as redirect } from './index-990cc22d.js';
2
- import { I as Identifier } from './Listenable-10f48463.js';
3
- export { a as Icon, L as Listenable, M as Message, T as Trigger } from './Listenable-10f48463.js';
2
+ import { I as Identifier, L as Listenable } from './Listenable-9c0fb198.js';
3
+ export { a as Icon, L as Listenable, M as Message, T as Trigger } from './Listenable-9c0fb198.js';
4
4
  export { G as GoogleFont } from './GoogleFont-8474516b.js';
5
5
  import './index-7b57a52c.js';
6
6
 
@@ -16,4 +16,11 @@ class ClientIdentifier {
16
16
  }
17
17
  }
18
18
 
19
- export { ClientIdentifier };
19
+ class StateBase {
20
+ constructor(...parameters) {
21
+ this.listenable = new Listenable();
22
+ this.client = parameters.length == 1 ? parameters[0] : undefined;
23
+ }
24
+ }
25
+
26
+ export { ClientIdentifier, StateBase };
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, a as getElement, c as createEvent, H as Host } from './index-7b57a52c.js';
2
2
  import { r as redirect, A as App, N as Notice } from './index-990cc22d.js';
3
- import { T as Trigger, M as Message, a as Icon } from './Listenable-10f48463.js';
3
+ import { T as Trigger, M as Message, a as Icon } from './Listenable-9c0fb198.js';
4
4
  import './GoogleFont-8474516b.js';
5
5
  import { D as Date$1, L as Language, g as getLanguage, a as DateTime, C as Currency, b as Locale, c as DateRange } from './getLanguage-225b37b0.js';
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h } from './index-7b57a52c.js';
2
- import { T as Trigger, M as Message } from './Listenable-10f48463.js';
2
+ import { T as Trigger, M as Message } from './Listenable-9c0fb198.js';
3
3
  import './GoogleFont-8474516b.js';
4
4
 
5
5
  const styleCss = ".sc-smoothly-trigger-sink-h{display:block}[hidden].sc-smoothly-trigger-sink-h{display:none}";
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, a as getElement } from './index-7b57a52c.js';
2
- import { M as Message, T as Trigger } from './Listenable-10f48463.js';
2
+ import { M as Message, T as Trigger } from './Listenable-9c0fb198.js';
3
3
  import './GoogleFont-8474516b.js';
4
4
 
5
5
  const styleCss = ".sc-smoothly-trigger-source-h{display:block}[hidden].sc-smoothly-trigger-source-h{display:none}";
@@ -1 +1 @@
1
- export{A as App,C as Cosmetic,N as Notice,r as redirect}from"./p-675a8d09.js";import{I as e}from"./p-bb57ff51.js";export{a as Icon,L as Listenable,M as Message,T as Trigger}from"./p-bb57ff51.js";export{G as GoogleFont}from"./p-bd478a53.js";import"./p-c88ae468.js";class o{constructor(){}static get value(){return o.valueCache=localStorage.getItem("clientIdentifier")||void 0,o.valueCache||(o.valueCache=e.generate(12),localStorage.setItem("clientIdentifier",o.valueCache)),o.valueCache}}export{o as ClientIdentifier}
1
+ export{A as App,C as Cosmetic,N as Notice,r as redirect}from"./p-675a8d09.js";import{I as s,L as e}from"./p-db43430d.js";export{a as Icon,L as Listenable,M as Message,T as Trigger}from"./p-db43430d.js";export{G as GoogleFont}from"./p-bd478a53.js";import"./p-c88ae468.js";class t{constructor(){}static get value(){return t.valueCache=localStorage.getItem("clientIdentifier")||void 0,t.valueCache||(t.valueCache=s.generate(12),localStorage.setItem("clientIdentifier",t.valueCache)),t.valueCache}}class o{constructor(...s){this.listenable=new e,this.client=1==s.length?s[0]:void 0}}export{t as ClientIdentifier,o as StateBase}