@txstate-mws/svelte-components 1.0.1 → 1.1.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/.eslintrc.cjs +37 -0
- package/README.md +33 -14
- package/docs/stores.md +1 -1
- package/package.json +24 -74
- package/playwright.config.js +112 -0
- package/src/app.html +14 -0
- package/src/global.d.ts +1 -0
- package/src/lib/actions/buttonify.ts +27 -0
- package/src/lib/actions/glue.ts +96 -0
- package/src/lib/actions/index.ts +7 -0
- package/src/lib/actions/offset.ts +43 -0
- package/src/lib/actions/portal.ts +13 -0
- package/src/lib/actions/resize.ts +72 -0
- package/src/lib/actions/sticky.ts +105 -0
- package/src/lib/actions/stickyfixed.ts +160 -0
- package/src/lib/components/Card.svelte +25 -0
- package/src/lib/components/CardLayout.svelte +188 -0
- package/{dist/ts → src/lib}/components/CollapsingTable.svelte +6 -5
- package/{dist/ts → src/lib}/components/ConditionalWrapper.svelte +0 -0
- package/{dist/ts → src/lib}/components/FocusLock.svelte +7 -6
- package/{dist/ts → src/lib}/components/Modal.svelte +5 -4
- package/src/lib/components/MultiSelect.svelte +174 -0
- package/{dist/ts → src/lib}/components/PopupMenu.svelte +22 -16
- package/{dist/ts → src/lib}/components/ScreenReaderOnly.svelte +2 -2
- package/src/lib/components/index.ts +9 -0
- package/src/lib/index.ts +4 -0
- package/src/lib/types/CardLayout.ts +14 -0
- package/src/lib/types/CollapsingTable.ts +8 -0
- package/src/lib/types/PopupMenu.ts +5 -0
- package/src/lib/types/index.ts +3 -0
- package/src/lib/util/bodyoffset.ts +77 -0
- package/src/lib/util/index.ts +3 -0
- package/src/lib/util/repositioned.ts +91 -0
- package/src/lib/util/util.ts +36 -0
- package/src/routes/__layout.svelte +125 -0
- package/src/routes/actions/index.svelte +1 -0
- package/src/routes/actions/offset.svelte +4 -0
- package/src/routes/actions/offsetdebounce.svelte +4 -0
- package/src/routes/actions/resize.svelte +4 -0
- package/src/routes/actions/resizedebounce.svelte +4 -0
- package/src/routes/actions/sticky.svelte +4 -0
- package/src/routes/cards/index.svelte +4 -0
- package/src/routes/cards/preserve.svelte +4 -0
- package/src/routes/collapsingtable/index.svelte +4 -0
- package/src/routes/collapsingtable/stickyheader.svelte +4 -0
- package/src/routes/index.svelte +2 -0
- package/src/routes/modal.svelte +4 -0
- package/src/routes/multiselect.svelte +4 -0
- package/src/routes/popupmenu/body.svelte +4 -0
- package/src/routes/popupmenu/complex.svelte +4 -0
- package/src/routes/popupmenu/empty.svelte +5 -0
- package/src/routes/popupmenu/index.svelte +4 -0
- package/src/routes/popupmenu/parent.svelte +4 -0
- package/src/routes/popupmenu/scrollable.svelte +27 -0
- package/src/routes/popupmenu/showselected.svelte +4 -0
- package/src/test/Cards.svelte +64 -0
- package/{dist/ts/tests/CollapsingTable → src/test}/CollapsingTableTest.svelte +2 -2
- package/{dist/ts/tests/Modal → src/test}/ModalTest.svelte +3 -3
- package/src/test/MultiSelectTest.svelte +26 -0
- package/{dist/ts/tests/Actions → src/test}/Offset.svelte +2 -4
- package/{dist/ts/tests/PopupMenu → src/test}/PopupMenuBody.svelte +1 -1
- package/{dist/ts/tests/PopupMenu → src/test}/PopupMenuButtonIsParent.svelte +2 -2
- package/{dist/ts/tests/PopupMenu → src/test}/PopupMenuComplex.svelte +2 -2
- package/{dist/ts/tests/PopupMenu → src/test}/PopupMenuSimple.svelte +2 -2
- package/{dist/ts/tests/Actions → src/test}/Resize.svelte +2 -4
- package/{dist/ts/tests/Actions → src/test}/Sticky.svelte +1 -1
- package/static/layout.css +263 -0
- package/svelte.config.js +15 -0
- package/tests/.eslintrc.cjs +19 -0
- package/tests/CardLayout.test.js +41 -0
- package/tests/CollapsingTable.test.js +37 -0
- package/tests/Modal.test.js +18 -0
- package/tests/MultiSelect.test.js +58 -0
- package/tests/PopupMenu.test.js +55 -0
- package/tests/common.js +4 -0
- package/tsconfig.json +31 -0
- package/LICENSE +0 -21
- package/dist/actions/buttonify.js +0 -31
- package/dist/actions/buttonify.js.map +0 -1
- package/dist/actions/glue.js +0 -87
- package/dist/actions/glue.js.map +0 -1
- package/dist/actions/index.js +0 -20
- package/dist/actions/index.js.map +0 -1
- package/dist/actions/offset.js +0 -35
- package/dist/actions/offset.js.map +0 -1
- package/dist/actions/portal.js +0 -19
- package/dist/actions/portal.js.map +0 -1
- package/dist/actions/resize.js +0 -48
- package/dist/actions/resize.js.map +0 -1
- package/dist/actions/sticky.js +0 -93
- package/dist/actions/sticky.js.map +0 -1
- package/dist/actions/stickyfixed.js +0 -166
- package/dist/actions/stickyfixed.js.map +0 -1
- package/dist/components/CollapsingTable.svelte +0 -147
- package/dist/components/ConditionalWrapper.svelte +0 -38
- package/dist/components/FocusLock.svelte +0 -105
- package/dist/components/Modal.svelte +0 -52
- package/dist/components/PopupMenu.svelte +0 -282
- package/dist/components/ScreenReaderOnly.svelte +0 -25
- package/dist/components/index.js +0 -19
- package/dist/components/index.js.map +0 -1
- package/dist/index.js +0 -17
- package/dist/index.js.map +0 -1
- package/dist/lib/activestore.js +0 -123
- package/dist/lib/activestore.js.map +0 -1
- package/dist/lib/bodyoffset.js +0 -76
- package/dist/lib/bodyoffset.js.map +0 -1
- package/dist/lib/convertedstore.js +0 -41
- package/dist/lib/convertedstore.js.map +0 -1
- package/dist/lib/derivedstore.js +0 -65
- package/dist/lib/derivedstore.js.map +0 -1
- package/dist/lib/index.js +0 -22
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/repositioned.js +0 -92
- package/dist/lib/repositioned.js.map +0 -1
- package/dist/lib/safestore.js +0 -16
- package/dist/lib/safestore.js.map +0 -1
- package/dist/lib/store.js +0 -27
- package/dist/lib/store.js.map +0 -1
- package/dist/lib/substore.js +0 -47
- package/dist/lib/substore.js.map +0 -1
- package/dist/lib/util.js +0 -16
- package/dist/lib/util.js.map +0 -1
- package/dist/ts/actions/buttonify.d.ts +0 -8
- package/dist/ts/actions/glue.d.ts +0 -16
- package/dist/ts/actions/index.d.ts +0 -7
- package/dist/ts/actions/offset.d.ts +0 -15
- package/dist/ts/actions/portal.d.ts +0 -4
- package/dist/ts/actions/resize.d.ts +0 -16
- package/dist/ts/actions/sticky.d.ts +0 -33
- package/dist/ts/actions/stickyfixed.d.ts +0 -25
- package/dist/ts/components/index.d.ts +0 -6
- package/dist/ts/index.d.ts +0 -4
- package/dist/ts/lib/activestore.d.ts +0 -60
- package/dist/ts/lib/bodyoffset.d.ts +0 -13
- package/dist/ts/lib/convertedstore.d.ts +0 -16
- package/dist/ts/lib/derivedstore.d.ts +0 -23
- package/dist/ts/lib/index.d.ts +0 -9
- package/dist/ts/lib/repositioned.d.ts +0 -13
- package/dist/ts/lib/safestore.d.ts +0 -4
- package/dist/ts/lib/store.d.ts +0 -16
- package/dist/ts/lib/substore.d.ts +0 -24
- package/dist/ts/lib/util.d.ts +0 -2
- package/dist/ts/tests/Actions/Actions.stories.d.ts +0 -1
- package/dist/ts/tests/CollapsingTable/CollapsingTable.stories.d.ts +0 -1
- package/dist/ts/tests/CollapsingTable/CollapsingTable.test.d.ts +0 -1
- package/dist/ts/tests/Modal/Modal.stories.d.ts +0 -1
- package/dist/ts/tests/Modal/Modal.test.d.ts +0 -1
- package/dist/ts/tests/PopupMenu/PopupMenu.stories.d.ts +0 -1
- package/dist/ts/tests/PopupMenu/PopupMenu.test.d.ts +0 -1
- package/dist/ts/tests/stores/deepstore.test.d.ts +0 -1
- package/dist/ts/types/CollapsingTable.d.ts +0 -8
- package/dist/ts/types/PopupMenu.d.ts +0 -5
- package/dist/ts/types/index.d.ts +0 -2
- package/dist/types/CollapsingTable.js +0 -3
- package/dist/types/CollapsingTable.js.map +0 -1
- package/dist/types/PopupMenu.js +0 -3
- package/dist/types/PopupMenu.js.map +0 -1
- package/dist/types/index.js +0 -15
- package/dist/types/index.js.map +0 -1
- package/esm/index.js +0 -1
- package/esm/package.json +0 -3
package/dist/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./components"), exports);
|
|
14
|
-
__exportStar(require("./actions"), exports);
|
|
15
|
-
__exportStar(require("./lib"), exports);
|
|
16
|
-
__exportStar(require("./types"), exports);
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA4B;AAC5B,4CAAyB;AACzB,wCAAqB;AACrB,0CAAuB"}
|
package/dist/lib/activestore.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ActiveStore = exports.isSettable = exports.isWritable = exports.isUsable = void 0;
|
|
4
|
-
function isUsable(value) {
|
|
5
|
-
return !!value && typeof value.subscribe === 'function';
|
|
6
|
-
}
|
|
7
|
-
exports.isUsable = isUsable;
|
|
8
|
-
function isWritable(value) {
|
|
9
|
-
return isUsable(value) && typeof value.update === 'function';
|
|
10
|
-
}
|
|
11
|
-
exports.isWritable = isWritable;
|
|
12
|
-
function isSettable(value) {
|
|
13
|
-
return isWritable(value) && typeof value.set === 'function';
|
|
14
|
-
}
|
|
15
|
-
exports.isSettable = isSettable;
|
|
16
|
-
/**
|
|
17
|
-
* An alternative to svelte's "writable" that does not check equality before notifying
|
|
18
|
-
* subscribers. A writable will notify subscribers after a shallow equality check, which
|
|
19
|
-
* does not work with mutated states:
|
|
20
|
-
* store.update(v => { v.someprop = 'newvalue'; return v })
|
|
21
|
-
*
|
|
22
|
-
* With a writable, this line would NOT notify subscribers because the state will be compared
|
|
23
|
-
* against itself and always found to be equal.
|
|
24
|
-
*
|
|
25
|
-
* An alternative to this store type is SafeStore, which will do a deep equality check but
|
|
26
|
-
* clone data so that it is safe against mutations. It costs more CPU cycles but results in
|
|
27
|
-
* fewer notifications to subscribers which could be an overall win.
|
|
28
|
-
*/
|
|
29
|
-
class ActiveStore {
|
|
30
|
-
constructor(value) {
|
|
31
|
-
this.cleanups = [];
|
|
32
|
-
this.sourceInits = [];
|
|
33
|
-
this.subscribers = new Map();
|
|
34
|
-
this.value = this.clone(value);
|
|
35
|
-
}
|
|
36
|
-
// this is here to support SafeStore: the regular store makes this a null-op, but
|
|
37
|
-
// SafeStore overrides the implementation to a deep clone operation
|
|
38
|
-
clone(value) {
|
|
39
|
-
return value;
|
|
40
|
-
}
|
|
41
|
-
// always returns false so that subscribers are notified on every `set` or `update`.
|
|
42
|
-
// Subclasses can override this for shallow or deep equality checks.
|
|
43
|
-
equal(a, b) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
set(value) {
|
|
47
|
-
if (!this.equal(value, this.value)) {
|
|
48
|
-
this.value = this.clone(value);
|
|
49
|
-
for (const [id, run] of this.subscribers) {
|
|
50
|
-
run(value);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
update(updater) {
|
|
55
|
-
// we have to send the user's updater function a cloned value, because they might mutate it
|
|
56
|
-
this.set(updater(this.clone(this.value)));
|
|
57
|
-
}
|
|
58
|
-
subscribe(run) {
|
|
59
|
-
// if we previously had no listeners, then we will have unsubscribed from our sources
|
|
60
|
-
// and we need to re-subscribe so our new listener will get updates
|
|
61
|
-
if (this.subscribers.size === 0)
|
|
62
|
-
this.subscribeToSources();
|
|
63
|
-
// generate a random id for this subscriber, it makes unsubscription O(1) instead of O(n)
|
|
64
|
-
let id;
|
|
65
|
-
do {
|
|
66
|
-
id = Math.random().toString(32);
|
|
67
|
-
} while (this.subscribers.has(id));
|
|
68
|
-
// register our new subscriber to receive updates
|
|
69
|
-
this.subscribers.set(id, run);
|
|
70
|
-
// immediately send the current value to our new subscriber
|
|
71
|
-
run(this.value);
|
|
72
|
-
// return an unsubscribe function
|
|
73
|
-
return () => {
|
|
74
|
-
this.subscribers.delete(id);
|
|
75
|
-
// if we have no listeners, stop listening to our sources for updates
|
|
76
|
-
// this makes it possible for us to be properly garbage collected
|
|
77
|
-
if (this.subscribers.size === 0)
|
|
78
|
-
this.unsubscribeFromSources();
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Provided as a last ditch avenue to clean up memory after rogue subscribers forget
|
|
83
|
-
* to unsubscribe themselves. For example, in an SSR environment one could clear out
|
|
84
|
-
* global stores anytime a request finishes and no other requests are being processed.
|
|
85
|
-
*/
|
|
86
|
-
clearSubscribers() {
|
|
87
|
-
this.subscribers.clear();
|
|
88
|
-
this.unsubscribeFromSources();
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Stores that subscribe to external events should set it up with a start/stop mentality
|
|
92
|
-
* so that the external events can be unsubscribed when the store itself has no listeners
|
|
93
|
-
* to notify. This helps ensure unused stores can be garbage collected.
|
|
94
|
-
*
|
|
95
|
-
* To do this, pass registerSource a function that initializes the subscription to the external
|
|
96
|
-
* event, and returns a function that can unsubscribe from the external event. This parent
|
|
97
|
-
* class will take care of running those functions at appropriate times.
|
|
98
|
-
*/
|
|
99
|
-
registerSource(fn) {
|
|
100
|
-
if (this.subscribers.size)
|
|
101
|
-
this.cleanups.push(fn());
|
|
102
|
-
this.sourceInits.push(fn);
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Provided in case a child class has a need to change out the external resources
|
|
106
|
-
*/
|
|
107
|
-
unregisterSources() {
|
|
108
|
-
this.unsubscribeFromSources();
|
|
109
|
-
this.sourceInits = [];
|
|
110
|
-
}
|
|
111
|
-
subscribeToSources() {
|
|
112
|
-
for (const fn of this.sourceInits) {
|
|
113
|
-
this.cleanups.push(fn());
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
unsubscribeFromSources() {
|
|
117
|
-
for (const fn of this.cleanups)
|
|
118
|
-
fn();
|
|
119
|
-
this.cleanups = [];
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
exports.ActiveStore = ActiveStore;
|
|
123
|
-
//# sourceMappingURL=activestore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"activestore.js","sourceRoot":"","sources":["../../src/lib/activestore.ts"],"names":[],"mappings":";;;AAcA,SAAgB,QAAQ,CAAM,KAAmC;IAC/D,OAAO,CAAC,CAAC,KAAK,IAAI,OAAQ,KAAa,CAAC,SAAS,KAAK,UAAU,CAAA;AAClE,CAAC;AAFD,4BAEC;AAED,SAAgB,UAAU,CAAM,KAAmC;IACjE,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAQ,KAAa,CAAC,MAAM,KAAK,UAAU,CAAA;AACvE,CAAC;AAFD,gCAEC;AAED,SAAgB,UAAU,CAAM,KAAmC;IACjE,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,OAAQ,KAAa,CAAC,GAAG,KAAK,UAAU,CAAA;AACtE,CAAC;AAFD,gCAEC;AAED;;;;;;;;;;;;GAYG;AACH,MAAa,WAAW;IAMtB,YAAa,KAAQ;QAHb,aAAQ,GAAmB,EAAE,CAAA;QAC7B,gBAAW,GAAyB,EAAE,CAAA;QAG5C,IAAI,CAAC,WAAW,GAAG,IAAI,GAAG,EAAE,CAAA;QAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;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AAC,MAAM,CAAC,EAAE,CAAC,CAAA;YAC3B,qEAAqE;YACrE,iEAAiE;YACjE,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC;gBAAE,IAAI,CAAC,sBAAsB,EAAE,CAAA;QAChE,CAAC,CAAA;IACH,CAAC;IAED;;;;OAIG;IACH,gBAAgB;QACd,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAA;QACxB,IAAI,CAAC,sBAAsB,EAAE,CAAA;IAC/B,CAAC;IAED;;;;;;;;OAQG;IACO,cAAc,CAAE,EAAoB;QAC5C,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI;YAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAA;QACnD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC3B,CAAC;IAED;;OAEG;IACO,iBAAiB;QACzB,IAAI,CAAC,sBAAsB,EAAE,CAAA;QAC7B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAA;IACvB,CAAC;IAEO,kBAAkB;QACxB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,WAAW,EAAE;YACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAA;SACzB;IACH,CAAC;IAEO,sBAAsB;QAC5B,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ;YAAE,EAAE,EAAE,CAAA;QACpC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAA;IACpB,CAAC;CACF;AAxGD,kCAwGC"}
|
package/dist/lib/bodyoffset.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sharedOffsetParent = exports.targetOffset = exports.bodyOffset = void 0;
|
|
4
|
-
function bodyOffset(ele) {
|
|
5
|
-
return targetOffset(ele, document.body);
|
|
6
|
-
}
|
|
7
|
-
exports.bodyOffset = bodyOffset;
|
|
8
|
-
function targetOffset(ele, target) {
|
|
9
|
-
const offset = targetOffsetRecursive(ele, target);
|
|
10
|
-
return Object.assign(Object.assign({}, offset), { right: target.offsetWidth - offset.left - ele.offsetWidth, bottom: target.offsetHeight - offset.top - ele.offsetHeight });
|
|
11
|
-
}
|
|
12
|
-
exports.targetOffset = targetOffset;
|
|
13
|
-
function sharedOffsetParent(a, b) {
|
|
14
|
-
if (!a || !b)
|
|
15
|
-
return undefined;
|
|
16
|
-
if (a.contains(b) && a.firstElementChild.offsetParent === a)
|
|
17
|
-
return a;
|
|
18
|
-
if (b.contains(a) && b.firstElementChild.offsetParent === b)
|
|
19
|
-
return b;
|
|
20
|
-
let c = a.offsetParent;
|
|
21
|
-
while (c instanceof HTMLElement && !c.contains(b))
|
|
22
|
-
c = c.offsetParent;
|
|
23
|
-
return c;
|
|
24
|
-
}
|
|
25
|
-
exports.sharedOffsetParent = sharedOffsetParent;
|
|
26
|
-
function targetOffsetRecursive(ele, target, currentOffset) {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
const { x, y } = getTranslate(ele);
|
|
29
|
-
const offset = {
|
|
30
|
-
top: ele.offsetTop + ((_a = currentOffset === null || currentOffset === void 0 ? void 0 : currentOffset.top) !== null && _a !== void 0 ? _a : 0) + y,
|
|
31
|
-
left: ele.offsetLeft + ((_b = currentOffset === null || currentOffset === void 0 ? void 0 : currentOffset.left) !== null && _b !== void 0 ? _b : 0) + x
|
|
32
|
-
};
|
|
33
|
-
if (ele.offsetParent instanceof HTMLElement && target !== ele.offsetParent && target.contains(ele.offsetParent))
|
|
34
|
-
return targetOffsetRecursive(ele.offsetParent, target, offset);
|
|
35
|
-
return offset;
|
|
36
|
-
}
|
|
37
|
-
function getTranslate(element) {
|
|
38
|
-
const style = window.getComputedStyle(element);
|
|
39
|
-
const matrix = style.transform;
|
|
40
|
-
// No transform property. Simply return 0 values.
|
|
41
|
-
if (matrix === 'none' || !matrix) {
|
|
42
|
-
return {
|
|
43
|
-
x: 0,
|
|
44
|
-
y: 0,
|
|
45
|
-
z: 0
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
// Can either be 2d or 3d transform
|
|
49
|
-
const matrixType = matrix.includes('3d') ? '3d' : '2d';
|
|
50
|
-
const matrixValues = matrix.match(/matrix.*\((.+)\)/)[1].split(', ');
|
|
51
|
-
// 2d matrices have 6 values
|
|
52
|
-
// Last 2 values are X and Y.
|
|
53
|
-
// 2d matrices does not have Z value.
|
|
54
|
-
if (matrixType === '2d') {
|
|
55
|
-
return {
|
|
56
|
-
x: Number(matrixValues[4]),
|
|
57
|
-
y: Number(matrixValues[5]),
|
|
58
|
-
z: 0
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
// 3d matrices have 16 values
|
|
62
|
-
// The 13th, 14th, and 15th values are X, Y, and Z
|
|
63
|
-
if (matrixType === '3d') {
|
|
64
|
-
return {
|
|
65
|
-
x: Number(matrixValues[12]),
|
|
66
|
-
y: Number(matrixValues[13]),
|
|
67
|
-
z: Number(matrixValues[14])
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
return {
|
|
71
|
-
x: 0,
|
|
72
|
-
y: 0,
|
|
73
|
-
z: 0
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=bodyoffset.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bodyoffset.js","sourceRoot":"","sources":["../../src/lib/bodyoffset.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAE,GAAgB;IAC1C,OAAO,YAAY,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;AACzC,CAAC;AAFD,gCAEC;AAED,SAAgB,YAAY,CAAE,GAAgB,EAAE,MAAmB;IACjE,MAAM,MAAM,GAAG,qBAAqB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IACjD,uCACK,MAAM,KACT,KAAK,EAAE,MAAM,CAAC,W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AM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;SAC5B,CAAA;KACF;IACD,OAAO;QACL,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;KACL,CAAA;AACH,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertStore = exports.ConvertedStore = void 0;
|
|
4
|
-
const store_1 = require("./store");
|
|
5
|
-
const activestore_1 = require("./activestore");
|
|
6
|
-
/**
|
|
7
|
-
* A store that allows you to pass in a traditional svelte store in the constructor.
|
|
8
|
-
*
|
|
9
|
-
* Updates to the original store will be sent to subscribers of this store, but only after a deep equality check.
|
|
10
|
-
*
|
|
11
|
-
* Updates to this store will also be sent to the original store after a deep equality check.
|
|
12
|
-
*/
|
|
13
|
-
class ConvertedStore extends store_1.Store {
|
|
14
|
-
constructor(value) {
|
|
15
|
-
super({});
|
|
16
|
-
this.pause = false;
|
|
17
|
-
this.valueStore = value;
|
|
18
|
-
this.registerSource(() => this.valueStore.subscribe(v => this.set(v)));
|
|
19
|
-
}
|
|
20
|
-
set(value) {
|
|
21
|
-
if (this.pause)
|
|
22
|
-
return;
|
|
23
|
-
if (!this.equal(value, this.value)) {
|
|
24
|
-
this.value = this.clone(value);
|
|
25
|
-
for (const [id, run] of this.subscribers) {
|
|
26
|
-
run(value);
|
|
27
|
-
}
|
|
28
|
-
if ((0, activestore_1.isSettable)(this.valueStore)) {
|
|
29
|
-
this.pause = true;
|
|
30
|
-
this.valueStore.set(value);
|
|
31
|
-
this.pause = false;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.ConvertedStore = ConvertedStore;
|
|
37
|
-
function convertStore(store) {
|
|
38
|
-
return new ConvertedStore(store);
|
|
39
|
-
}
|
|
40
|
-
exports.convertStore = convertStore;
|
|
41
|
-
//# sourceMappingURL=convertedstore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convertedstore.js","sourceRoot":"","sources":["../../src/lib/convertedstore.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAC/B,+CAAyD;AAEzD;;;;;;GAMG;AACH,MAAa,cAAkB,SAAQ,aAAQ;IAI7C,YAAa,KAAuB;QAClC,KAAK,CAAC,EAAS,CAAC,CAAA;QAHV,UAAK,GAAG,KAAK,CAAA;QAInB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAA;QACvB,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACxE,CAAC;IAED,GAAG,CAAE,KAAQ;QACX,IAAI,IAAI,CAAC,KAAK;YAAE,OAAM;QACtB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;YAClC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YAC9B,KAAK,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE;gBACxC,GAAG,CAAC,KAAK,CAAC,CAAA;aACX;YACD,IAAI,IAAA,wBAAU,EAAC,IAAI,CAAC,UAAU,CAAC,EAAE;gBAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;gBACjB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;gBAC1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;aACnB;SACF;IACH,CAAC;CACF;AAxBD,wCAwBC;AAED,SAAgB,YAAY,CAAM,KAAuB;IACvD,OAAO,IAAI,cAAc,CAAC,KAAK,CAAC,CAAA;AAClC,CAAC;AAFD,oCAEC"}
|
package/dist/lib/derivedstore.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.derivedStore = exports.DerivedStore = void 0;
|
|
4
|
-
const store_1 = require("./store");
|
|
5
|
-
const txstate_utils_1 = require("txstate-utils");
|
|
6
|
-
/**
|
|
7
|
-
* Watch one or more parent stores for changes. Each time, run a function to derive
|
|
8
|
-
* a new state from the parent state(s). Subscribers will only be notified if the
|
|
9
|
-
* derived state has changed (uses fast-deep-equal).
|
|
10
|
-
*
|
|
11
|
-
* If only one parent store, it's possible to use a dot-prop string as the getter.
|
|
12
|
-
*/
|
|
13
|
-
class DerivedStore extends store_1.Store {
|
|
14
|
-
constructor(store, getter, options) {
|
|
15
|
-
if (typeof getter === 'string') {
|
|
16
|
-
const accessor = getter;
|
|
17
|
-
getter = (parentValue) => (0, txstate_utils_1.get)(parentValue, accessor);
|
|
18
|
-
}
|
|
19
|
-
super({});
|
|
20
|
-
if (Array.isArray(store)) {
|
|
21
|
-
const values = [];
|
|
22
|
-
let timer;
|
|
23
|
-
const superSet = () => super.set(getter(values));
|
|
24
|
-
const superSetDebounced = (options === null || options === void 0 ? void 0 : options.debounce) == null || (options === null || options === void 0 ? void 0 : options.debounce) === false || (options === null || options === void 0 ? void 0 : options.debounce) < 0
|
|
25
|
-
? superSet
|
|
26
|
-
: () => {
|
|
27
|
-
clearTimeout(timer);
|
|
28
|
-
timer = setTimeout(superSet, options.debounce === true ? 0 : options.debounce);
|
|
29
|
-
};
|
|
30
|
-
for (let i = 0; i < store.length; i++) {
|
|
31
|
-
const idx = i;
|
|
32
|
-
const st = store[i];
|
|
33
|
-
if (st instanceof store_1.Store) {
|
|
34
|
-
this.registerSource(() => st.subscribe(v => {
|
|
35
|
-
values[idx] = st.clone(v);
|
|
36
|
-
superSetDebounced();
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
this.registerSource(() => st.subscribe(v => {
|
|
41
|
-
values[idx] = v;
|
|
42
|
-
superSetDebounced();
|
|
43
|
-
}));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
let timer;
|
|
49
|
-
const superSet = (v) => super.set(getter(v));
|
|
50
|
-
const superSetDebounced = (options === null || options === void 0 ? void 0 : options.debounce) == null || (options === null || options === void 0 ? void 0 : options.debounce) === false || (options === null || options === void 0 ? void 0 : options.debounce) < 0
|
|
51
|
-
? superSet
|
|
52
|
-
: (v) => {
|
|
53
|
-
clearTimeout(timer);
|
|
54
|
-
timer = setTimeout(() => superSet(v), options.debounce === true ? 0 : options.debounce);
|
|
55
|
-
};
|
|
56
|
-
this.registerSource(() => store.subscribe(superSetDebounced));
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
exports.DerivedStore = DerivedStore;
|
|
61
|
-
function derivedStore(store, getter, options) {
|
|
62
|
-
return new DerivedStore(store, getter, options);
|
|
63
|
-
}
|
|
64
|
-
exports.derivedStore = derivedStore;
|
|
65
|
-
//# sourceMappingURL=derivedstore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"derivedstore.js","sourceRoot":"","sources":["../../src/lib/derivedstore.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAE/B,iDAAmC;AAMnC;;;;;;GAMG;AACH,MAAa,YAA4C,SAAQ,aAAkB;IACjF,YAAa,KAAqD,EAAE,MAA6E,EAAE,OAA6B;QAC9K,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;YAC9B,MAAM,QAAQ,GAAG,MAAM,CAAA;YACvB,MAAM,GAAG,CAAC,WAAgB,EAAE,EAAE,CAAC,IAAA,mBAAG,EAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;SAC1D;QACD,KAAK,CAAC,EAAS,CAAC,CAAA;QAChB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACxB,MAAM,MAAM,G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C,CAAA;wBACf,iBAAiB,EAAE,CAAA;oBACrB,CAAC,CAAC,CAAC,CAAA;iBACJ;aACF;SACF;aAAM;YACL,IAAI,KAAU,CAAA;YACd,MAAM,QAAQ,GAAG,CAAC,CAAM,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAE,MAAsC,CAAC,CAAC,CAAC,CAAC,CAAA;YAClF,MAAM,iBAAiB,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,KAAI,IAAI,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,MAAK,KAAK,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,IAAG,CAAC;gBACzG,CAAC,CAAC,QAAQ;gBACV,CAAC,CAAC,CAAC,CAAM,EAAE,EAAE;oBACT,YAAY,CAAC,KAAK,CAAC,CAAA;oBACnB,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAkB,CAAC,CAAA;gBACnG,CAAC,CAAA;YACL,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAA;SAC9D;IACH,CAAC;CACF;AA5CD,oCA4CC;AAUD,SAAgB,YAAY,CAAgB,KAA8C,EAAE,MAA6E,EAAE,OAA6B;IACtM,OAAO,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;AACjD,CAAC;AAFD,oCAEC"}
|
package/dist/lib/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./bodyoffset"), exports);
|
|
14
|
-
__exportStar(require("./convertedstore"), exports);
|
|
15
|
-
__exportStar(require("./derivedstore"), exports);
|
|
16
|
-
__exportStar(require("./activestore"), exports);
|
|
17
|
-
__exportStar(require("./repositioned"), exports);
|
|
18
|
-
__exportStar(require("./safestore"), exports);
|
|
19
|
-
__exportStar(require("./store"), exports);
|
|
20
|
-
__exportStar(require("./substore"), exports);
|
|
21
|
-
__exportStar(require("./util"), exports);
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
package/dist/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA4B;AAC5B,mDAAgC;AAChC,iDAA8B;AAC9B,gDAA6B;AAC7B,iDAA8B;AAC9B,8CAA2B;AAC3B,0CAAuB;AACvB,6CAA0B;AAC1B,yCAAsB"}
|
package/dist/lib/repositioned.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.watchForPositionChangeInContainer = exports.watchForPositionChange = exports.watchForMutations = void 0;
|
|
7
|
-
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
8
|
-
const txstate_utils_1 = require("txstate-utils");
|
|
9
|
-
const bodyoffset_1 = require("./bodyoffset");
|
|
10
|
-
const observers = new Map();
|
|
11
|
-
let mutationobserver;
|
|
12
|
-
function watchForMutations(cb) {
|
|
13
|
-
function watch() {
|
|
14
|
-
for (const cb of observers.values())
|
|
15
|
-
cb();
|
|
16
|
-
}
|
|
17
|
-
if (observers.size === 0) {
|
|
18
|
-
mutationobserver !== null && mutationobserver !== void 0 ? mutationobserver : (mutationobserver = new MutationObserver(watch));
|
|
19
|
-
window.addEventListener('resize', watch, { passive: true });
|
|
20
|
-
mutationobserver.observe(document.body, {
|
|
21
|
-
subtree: true,
|
|
22
|
-
childList: true,
|
|
23
|
-
attributes: true,
|
|
24
|
-
characterData: true
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
const id = (0, txstate_utils_1.randomid)();
|
|
28
|
-
observers.set(id, cb);
|
|
29
|
-
cb();
|
|
30
|
-
return {
|
|
31
|
-
destroy() {
|
|
32
|
-
observers.delete(id);
|
|
33
|
-
if (observers.size === 0) {
|
|
34
|
-
window.removeEventListener('resize', watch);
|
|
35
|
-
mutationobserver.disconnect();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
exports.watchForMutations = watchForMutations;
|
|
41
|
-
function watchForPositionChange(el, cb) {
|
|
42
|
-
let lastoffsets = [];
|
|
43
|
-
let els = (0, txstate_utils_1.toArray)(el).filter(txstate_utils_1.isNotNull);
|
|
44
|
-
function watch() {
|
|
45
|
-
const offsets = els.map(bodyoffset_1.bodyOffset);
|
|
46
|
-
if (offsets.some((offset, i) => !(0, fast_deep_equal_1.default)(offset, lastoffsets[i]))) {
|
|
47
|
-
lastoffsets = offsets;
|
|
48
|
-
Array.isArray(el) ? cb(offsets) : cb(offsets[0]);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
const { destroy } = watchForMutations(watch);
|
|
52
|
-
return {
|
|
53
|
-
update(newEl, newCb) {
|
|
54
|
-
const changed = newEl !== el || newCb !== cb;
|
|
55
|
-
if (changed) {
|
|
56
|
-
el = newEl;
|
|
57
|
-
els = (0, txstate_utils_1.toArray)(el).filter(txstate_utils_1.isNotNull);
|
|
58
|
-
cb = newCb;
|
|
59
|
-
watch();
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
destroy
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
exports.watchForPositionChange = watchForPositionChange;
|
|
66
|
-
function watchForPositionChangeInContainer(el, container, cb) {
|
|
67
|
-
let lastoffset;
|
|
68
|
-
function watch() {
|
|
69
|
-
if (!el || !container)
|
|
70
|
-
return;
|
|
71
|
-
const offset = (0, bodyoffset_1.targetOffset)(el, container);
|
|
72
|
-
if (!(0, fast_deep_equal_1.default)(offset, lastoffset)) {
|
|
73
|
-
lastoffset = offset;
|
|
74
|
-
cb(offset);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
const { destroy } = watchForMutations(watch);
|
|
78
|
-
return {
|
|
79
|
-
update(newEl, newContainer, newCb) {
|
|
80
|
-
const changed = newEl !== el || newContainer !== container || newCb !== cb;
|
|
81
|
-
if (changed) {
|
|
82
|
-
el = newEl;
|
|
83
|
-
container = newContainer;
|
|
84
|
-
cb = newCb;
|
|
85
|
-
watch();
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
destroy
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
exports.watchForPositionChangeInContainer = watchForPositionChangeInContainer;
|
|
92
|
-
//# sourceMappingURL=repositioned.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repositioned.js","sourceRoot":"","sources":["../../src/lib/repositioned.ts"],"names":[],"mappings":";;;;;;AAAA,sEAAmC;AACnC,iDAA4D;AAC5D,6CAAuD;AAIvD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAsB,CAAA;AAC/C,I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AED,MAAM,EAAE,OAAO,EAAE,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAA;IAE5C,OAAO;QACL,MAAM,CAAE,KAA4B,EAAE,YAAmC,EAAE,KAAiD;YAC1H,MAAM,OAAO,GAAG,KAAK,KAAK,EAAE,IAAI,YAAY,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,CAAA;YAC1E,IAAI,OAAO,EAAE;gBACX,EAAE,GAAG,KAAK,CAAA;gBACV,SAAS,GAAG,YAAY,CAAA;gBACxB,EAAE,GAAG,KAAK,CAAA;gBACV,KAAK,EAAE,CAAA;aACR;QACH,CAAC;QACD,OAAO;KACR,CAAA;AACH,CAAC;AA1BD,8EA0BC"}
|
package/dist/lib/safestore.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SafeStore = void 0;
|
|
7
|
-
const store_1 = require("./store");
|
|
8
|
-
const rfdc_1 = __importDefault(require("rfdc"));
|
|
9
|
-
const cloneDeep = (0, rfdc_1.default)();
|
|
10
|
-
class SafeStore extends store_1.Store {
|
|
11
|
-
clone(value) {
|
|
12
|
-
return cloneDeep(value);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.SafeStore = SafeStore;
|
|
16
|
-
//# sourceMappingURL=safestore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"safestore.js","sourceRoot":"","sources":["../../src/lib/safestore.ts"],"names":[],"mappings":";;;;;;AAAA,mCAA+B;AAC/B,gDAAuB;AACvB,MAAM,SAAS,GAAG,IAAA,cAAI,GAAE,CAAA;AAExB,MAAa,SAAa,SAAQ,aAAQ;IACxC,KAAK,CAAE,KAAQ;QACb,OAAO,SAAS,CAAC,KAAK,CAAC,CAAA;IACzB,CAAC;CACF;AAJD,8BAIC"}
|
package/dist/lib/store.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Store = void 0;
|
|
7
|
-
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
8
|
-
const activestore_1 = require("./activestore");
|
|
9
|
-
/**
|
|
10
|
-
* An alternative to svelte's "writable" that also checks deep equality (fast-deep-equal) before
|
|
11
|
-
* notifying subscribers. A writable will notify subscribers after a shallow equality check, which
|
|
12
|
-
* only works for scalars.
|
|
13
|
-
*
|
|
14
|
-
* Note that this strategy is weak against mutable state updates:
|
|
15
|
-
* store.update(v => { v.someprop = 'newvalue'; return v })
|
|
16
|
-
*
|
|
17
|
-
* This line would NOT notify subscribers because the state will be compared against
|
|
18
|
-
* itself and always found to be equal. If you are making updates in a mutable fashion,
|
|
19
|
-
* use a SafeStore instead.
|
|
20
|
-
*/
|
|
21
|
-
class Store extends activestore_1.ActiveStore {
|
|
22
|
-
equal(a, b) {
|
|
23
|
-
return (0, fast_deep_equal_1.default)(a, b);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.Store = Store;
|
|
27
|
-
//# sourceMappingURL=store.js.map
|
package/dist/lib/store.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/lib/store.ts"],"names":[],"mappings":";;;;;;AAAA,sEAAuC;AACvC,+CAA2C;AAE3C;;;;;;;;;;;GAWG;AACH,MAAa,KAAS,SAAQ,yBAAc;IAC1C,KAAK,CAAE,CAAI,EAAE,CAAI;QACf,OAAO,IAAA,yBAAS,EAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACxB,CAAC;CACF;AAJD,sBAIC"}
|
package/dist/lib/substore.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.subStore = exports.SubStore = void 0;
|
|
4
|
-
const txstate_utils_1 = require("txstate-utils");
|
|
5
|
-
const store_1 = require("./store");
|
|
6
|
-
/**
|
|
7
|
-
* Create a store that represents a part of a larger store. Updates to the parent store will propagate
|
|
8
|
-
* down to the SubStore as appropriate, and updates to the SubStore will propagate
|
|
9
|
-
* back up to the parent store. This requires both a getter and setter function to handle each
|
|
10
|
-
* direction. The setter is given the new SubStore state and the existing parent store state and
|
|
11
|
-
* should return a new state for the parent store.
|
|
12
|
-
*
|
|
13
|
-
* Alternatively, a dot-prop string can be provided and both the getter and setter will be automatically
|
|
14
|
-
* generated. For example, a parent store containing state { deep: { value: 'here' }, hello: 'world' }
|
|
15
|
-
* could be used with the getter string "deep.value". The SubStore's initial state would be "here", and
|
|
16
|
-
* updating it to "there" would update the parent store state to { deep: { value: 'there' }, hello: 'world' }
|
|
17
|
-
*/
|
|
18
|
-
class SubStore extends store_1.Store {
|
|
19
|
-
constructor(store, getter, setter) {
|
|
20
|
-
super({});
|
|
21
|
-
if (typeof getter === 'string') {
|
|
22
|
-
const accessor = getter;
|
|
23
|
-
getter = parentValue => (0, txstate_utils_1.get)(parentValue, accessor);
|
|
24
|
-
setter = (newValue, parentValue) => (0, txstate_utils_1.set)(parentValue, accessor, newValue);
|
|
25
|
-
}
|
|
26
|
-
this.parentStore = store;
|
|
27
|
-
this.setter = setter;
|
|
28
|
-
this.registerSource(() => store.subscribe(v => {
|
|
29
|
-
super.set(getter(v));
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
set(value) {
|
|
33
|
-
this.parentStore.update(parentValue => this.setter(value, parentValue));
|
|
34
|
-
}
|
|
35
|
-
clone(state) {
|
|
36
|
-
var _a, _b, _c;
|
|
37
|
-
// parent store could be a SafeStore - if so we should use its clone function
|
|
38
|
-
// so that the substore is also safe against mutations
|
|
39
|
-
return (_c = (_b = (_a = this.parentStore) === null || _a === void 0 ? void 0 : _a.clone) === null || _b === void 0 ? void 0 : _b.call(_a, state)) !== null && _c !== void 0 ? _c : state;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.SubStore = SubStore;
|
|
43
|
-
function subStore(store, getter, setter) {
|
|
44
|
-
return new SubStore(store, getter, setter);
|
|
45
|
-
}
|
|
46
|
-
exports.subStore = subStore;
|
|
47
|
-
//# sourceMappingURL=substore.js.map
|
package/dist/lib/substore.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"substore.js","sourceRoot":"","sources":["../../src/lib/substore.ts"],"names":[],"mappings":";;;AAAA,iDAAwC;AACxC,mCAA+B;AAG/B;;;;;;;;;;;GAWG;AACH,MAAa,QAAoC,SAAQ,aAAc;IAIrE,YAAa,KAAkC,EAAE,MAAgE,EAAE,MAA0D;QAC3K,KAAK,CAAC,EAAS,CAAC,CAAA;QAChB,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;YAC9B,MAAM,QAAQ,GAAG,MAAM,CAAA;YACvB,MAAM,GAAG,WAAW,CAAC,EAAE,CAAC,IAAA,mBAAG,EAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;YAClD,MAAM,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,CAAC,IAAA,mBAAG,EAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;SACzE;QACD,IAAI,CAAC,WAAW,GAAG,KAAK,CAAA;QACxB,IAAI,CAAC,MAAM,GAAG,MAAO,CAAA;QACrB,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;YAC5C,KAAK,CAAC,GAAG,CAAE,MAAc,CAAC,CAAC,CAAC,CAAC,CAAA;QAC/B,CAAC,CAAC,CAAC,CAAA;IACL,CAAC;IAED,GAAG,CAAE,KAAc;QACjB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAA;IACzE,CAAC;IAED,KAAK,CAAE,KAAc;;QACnB,6EAA6E;QAC7E,sDAAsD;QACtD,OAAO,MAAA,MAAA,MAAC,IAAI,CAAC,WAA0B,0CAAE,KAAK,mDAAG,KAAK,CAAC,mCAAI,KAAK,CAAA;IAClE,CAAC;CACF;AA3BD,4BA2BC;AAKD,SAAgB,QAAQ,CAAwB,KAAkC,EAAE,MAAgE,EAAE,MAA0D;IAC9M,OAAO,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAC5C,CAAC;AAFD,4BAEC"}
|
package/dist/lib/util.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.debounced = exports.classes = void 0;
|
|
4
|
-
function classes(...classNames) {
|
|
5
|
-
return classNames.filter(Boolean).join(' ');
|
|
6
|
-
}
|
|
7
|
-
exports.classes = classes;
|
|
8
|
-
function debounced(fn, timeout) {
|
|
9
|
-
let timer;
|
|
10
|
-
return (...args) => {
|
|
11
|
-
clearTimeout(timer);
|
|
12
|
-
timer = setTimeout(() => fn(...args), timeout);
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
exports.debounced = debounced;
|
|
16
|
-
//# sourceMappingURL=util.js.map
|
package/dist/lib/util.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/lib/util.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,CAAE,GAAG,UAAkC;IAC5D,OAAO,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC7C,CAAC;AAFD,0BAEC;AAED,SAAgB,SAAS,CAAE,EAAY,EAAE,OAAe;IACtD,IAAI,KAAqB,CAAA;IACzB,OAAO,CAAC,GAAG,IAAW,EAAE,EAAE;QACxB,YAAY,CAAC,KAAK,CAAC,CAAA;QACnB,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,OAAO,CAAC,CAAA;IAChD,CAAC,CAAA;AACH,CAAC;AAND,8BAMC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Turns any HTML element into an accessible button that responds to keyboard events and has
|
|
3
|
-
* role="button" and the tabindex attribute set. You are still responsible for making sure it has
|
|
4
|
-
* readable content or a good label.
|
|
5
|
-
*/
|
|
6
|
-
export declare function buttonify(node: HTMLElement): {
|
|
7
|
-
destroy(): void;
|
|
8
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { SettableSubject } from '../lib';
|
|
2
|
-
export declare type GlueAlignOpts = 'auto' | 'bottomleft' | 'bottomright' | 'topleft' | 'topright';
|
|
3
|
-
export interface GlueArgs<T extends GlueAlignStore = GlueAlignStore> {
|
|
4
|
-
target: HTMLElement;
|
|
5
|
-
align?: GlueAlignOpts;
|
|
6
|
-
cover?: boolean;
|
|
7
|
-
store?: SettableSubject<T>;
|
|
8
|
-
}
|
|
9
|
-
export interface GlueAlignStore {
|
|
10
|
-
valign: 'bottom' | 'top';
|
|
11
|
-
halign: 'left' | 'right';
|
|
12
|
-
}
|
|
13
|
-
export declare function glue(el: HTMLElement, { target, align, cover, store }: GlueArgs): {
|
|
14
|
-
update({ target: utarget, align: ualign, cover: ucover, store: ustore }: GlueArgs): void;
|
|
15
|
-
destroy: () => void;
|
|
16
|
-
};
|