@startinblox/core 0.19.0-beta.1 → 0.19.0-beta.3

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.
Files changed (166) hide show
  1. package/dist/{_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css → assets/MarkerCluster-614dea0a.css} +0 -0
  2. package/dist/{_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css → assets/MarkerCluster.Default-61258232.css} +0 -0
  3. package/dist/assets/en-e53105c5.js +14 -0
  4. package/dist/assets/en-e53105c5.js.map +1 -0
  5. package/dist/assets/fr-a7fcdb64.js +14 -0
  6. package/dist/assets/fr-a7fcdb64.js.map +1 -0
  7. package/dist/{_snowpack/pkg/fusejs.js → assets/helpers-bf15809c.js} +398 -454
  8. package/dist/assets/helpers-bf15809c.js.map +1 -0
  9. package/dist/{_snowpack/pkg/leaflet/dist/leaflet.css → assets/leaflet-3c081932.css} +3 -3
  10. package/dist/helpers.js +18 -0
  11. package/dist/helpers.js.map +1 -0
  12. package/dist/index.js +54523 -48
  13. package/dist/index.js.map +1 -0
  14. package/package.json +7 -22
  15. package/dist/_snowpack/pkg/autolinker.js +0 -4429
  16. package/dist/_snowpack/pkg/autolinker.js.map +0 -1
  17. package/dist/_snowpack/pkg/common/_baseUnary-d2677655.js +0 -353
  18. package/dist/_snowpack/pkg/common/_baseUnary-d2677655.js.map +0 -1
  19. package/dist/_snowpack/pkg/common/_commonjsHelpers-0597c316.js +0 -26
  20. package/dist/_snowpack/pkg/common/_commonjsHelpers-0597c316.js.map +0 -1
  21. package/dist/_snowpack/pkg/common/decode-26fbf385.js +0 -185
  22. package/dist/_snowpack/pkg/common/decode-26fbf385.js.map +0 -1
  23. package/dist/_snowpack/pkg/common/lit-html-3647afce.js +0 -1104
  24. package/dist/_snowpack/pkg/common/lit-html-3647afce.js.map +0 -1
  25. package/dist/_snowpack/pkg/delta-markdown-for-quill.js +0 -26198
  26. package/dist/_snowpack/pkg/delta-markdown-for-quill.js.map +0 -1
  27. package/dist/_snowpack/pkg/dialog-polyfill.js +0 -826
  28. package/dist/_snowpack/pkg/dialog-polyfill.js.map +0 -1
  29. package/dist/_snowpack/pkg/fusejs.js.map +0 -1
  30. package/dist/_snowpack/pkg/import-map.json +0 -25
  31. package/dist/_snowpack/pkg/jsonld-context-parser.js +0 -836
  32. package/dist/_snowpack/pkg/jsonld-context-parser.js.map +0 -1
  33. package/dist/_snowpack/pkg/jsonld.js +0 -11760
  34. package/dist/_snowpack/pkg/jsonld.js.map +0 -1
  35. package/dist/_snowpack/pkg/leaflet/dist/leaflet.css.proxy.js +0 -10
  36. package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css.proxy.js +0 -10
  37. package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css.proxy.js +0 -10
  38. package/dist/_snowpack/pkg/lit-html/directives/if-defined.js +0 -39
  39. package/dist/_snowpack/pkg/lit-html/directives/if-defined.js.map +0 -1
  40. package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js +0 -48
  41. package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js.map +0 -1
  42. package/dist/_snowpack/pkg/lit-html/directives/until.js +0 -87
  43. package/dist/_snowpack/pkg/lit-html/directives/until.js.map +0 -1
  44. package/dist/_snowpack/pkg/lit-html.js +0 -94
  45. package/dist/_snowpack/pkg/lit-html.js.map +0 -1
  46. package/dist/_snowpack/pkg/markdown-it-link-attributes.js +0 -68
  47. package/dist/_snowpack/pkg/markdown-it-link-attributes.js.map +0 -1
  48. package/dist/_snowpack/pkg/markdown-it.js +0 -11307
  49. package/dist/_snowpack/pkg/markdown-it.js.map +0 -1
  50. package/dist/_snowpack/pkg/quill/dist/quill.snow.css.proxy.js +0 -10
  51. package/dist/_snowpack/pkg/quill-delta-to-markdown.js +0 -971
  52. package/dist/_snowpack/pkg/quill-delta-to-markdown.js.map +0 -1
  53. package/dist/_snowpack/pkg/quill.js +0 -14441
  54. package/dist/_snowpack/pkg/quill.js.map +0 -1
  55. package/dist/_snowpack/pkg/slim-select.js +0 -714
  56. package/dist/_snowpack/pkg/slim-select.js.map +0 -1
  57. package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css +0 -1149
  58. package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css.proxy.js +0 -10
  59. package/dist/_snowpack/pkg/tui-calendar.js +0 -46503
  60. package/dist/_snowpack/pkg/tui-calendar.js.map +0 -1
  61. package/dist/components/solid-ac-checker.js +0 -45
  62. package/dist/components/solid-calendar.js +0 -66
  63. package/dist/components/solid-delete.js +0 -96
  64. package/dist/components/solid-display.js +0 -150
  65. package/dist/components/solid-form-search.js +0 -173
  66. package/dist/components/solid-form.js +0 -257
  67. package/dist/components/solid-lang.js +0 -35
  68. package/dist/components/solid-map.js +0 -204
  69. package/dist/components/solid-table.js +0 -181
  70. package/dist/components/solid-widget.js +0 -72
  71. package/dist/import.css +0 -4
  72. package/dist/libs/Component.js +0 -13
  73. package/dist/libs/ComponentFactory.js +0 -165
  74. package/dist/libs/Compositor.js +0 -96
  75. package/dist/libs/Sib.js +0 -44
  76. package/dist/libs/filter.js +0 -184
  77. package/dist/libs/helpers.js +0 -185
  78. package/dist/libs/interfaces.js +0 -6
  79. package/dist/libs/lit-helpers.js +0 -139
  80. package/dist/libs/polyfills.js +0 -35
  81. package/dist/libs/store/custom-getter.js +0 -344
  82. package/dist/libs/store/server-pagination.js +0 -19
  83. package/dist/libs/store/server-search.js +0 -32
  84. package/dist/libs/store/store.js +0 -560
  85. package/dist/locales/en.json +0 -10
  86. package/dist/locales/en.json.proxy.js +0 -2
  87. package/dist/locales/fr.json +0 -10
  88. package/dist/locales/fr.json.proxy.js +0 -2
  89. package/dist/mixins/attributeBinderMixin.js +0 -113
  90. package/dist/mixins/contextMixin.js +0 -26
  91. package/dist/mixins/counterMixin.js +0 -54
  92. package/dist/mixins/federationMixin.js +0 -57
  93. package/dist/mixins/filterMixin.js +0 -152
  94. package/dist/mixins/grouperMixin.js +0 -73
  95. package/dist/mixins/highlighterMixin.js +0 -36
  96. package/dist/mixins/interfaces.js +0 -6
  97. package/dist/mixins/listMixin.js +0 -116
  98. package/dist/mixins/nextMixin.js +0 -23
  99. package/dist/mixins/paginateMixin.js +0 -97
  100. package/dist/mixins/requiredMixin.js +0 -38
  101. package/dist/mixins/serverPaginationMixin.js +0 -122
  102. package/dist/mixins/sorterMixin.js +0 -131
  103. package/dist/mixins/storeMixin.js +0 -139
  104. package/dist/mixins/translationMixin.js +0 -58
  105. package/dist/mixins/validationMixin.js +0 -95
  106. package/dist/mixins/widgetMixin.js +0 -358
  107. package/dist/new-widgets/attributeMixins/actionMixin.js +0 -13
  108. package/dist/new-widgets/attributeMixins/blankMixin.js +0 -7
  109. package/dist/new-widgets/attributeMixins/booleanMixin.js +0 -7
  110. package/dist/new-widgets/attributeMixins/index.js +0 -19
  111. package/dist/new-widgets/attributeMixins/mailtoMixin.js +0 -7
  112. package/dist/new-widgets/attributeMixins/multipleMixin.js +0 -27
  113. package/dist/new-widgets/attributeMixins/numberMixin.js +0 -7
  114. package/dist/new-widgets/attributeMixins/placeholderMixin.js +0 -16
  115. package/dist/new-widgets/attributeMixins/telMixin.js +0 -7
  116. package/dist/new-widgets/baseWidgetMixin.js +0 -109
  117. package/dist/new-widgets/callbackMixins/autocompletionMixin.js +0 -96
  118. package/dist/new-widgets/callbackMixins/index.js +0 -7
  119. package/dist/new-widgets/callbackMixins/richtextMixin.js +0 -37
  120. package/dist/new-widgets/callbackMixins/slimselect.css.proxy.js +0 -10
  121. package/dist/new-widgets/interfaces.js +0 -1
  122. package/dist/new-widgets/new-widget-factory.js +0 -91
  123. package/dist/new-widgets/templateAdditionMixins/addableMixin.js +0 -26
  124. package/dist/new-widgets/templateAdditionMixins/index.js +0 -13
  125. package/dist/new-widgets/templateAdditionMixins/labelLastMixin.js +0 -16
  126. package/dist/new-widgets/templateAdditionMixins/labelMixin.js +0 -18
  127. package/dist/new-widgets/templates/defaultTemplatesDirectory.js +0 -29
  128. package/dist/new-widgets/templates/displayTemplatesDirectory.js +0 -54
  129. package/dist/new-widgets/templates/formTemplatesDirectory.js +0 -423
  130. package/dist/new-widgets/templates/groupTemplatesDirectory.js +0 -11
  131. package/dist/new-widgets/templates/index.js +0 -6
  132. package/dist/new-widgets/templates/setTemplatesDirectory.js +0 -16
  133. package/dist/new-widgets/templatesDependencies/altMixin.js +0 -12
  134. package/dist/new-widgets/templatesDependencies/editableMixin.js +0 -60
  135. package/dist/new-widgets/templatesDependencies/filterRangeFormMixin.js +0 -34
  136. package/dist/new-widgets/templatesDependencies/formCheckboxMixin.js +0 -10
  137. package/dist/new-widgets/templatesDependencies/formCheckboxesMixin.js +0 -41
  138. package/dist/new-widgets/templatesDependencies/formDropdownMixin.js +0 -59
  139. package/dist/new-widgets/templatesDependencies/formFileMixin.js +0 -82
  140. package/dist/new-widgets/templatesDependencies/formLengthMixin.js +0 -18
  141. package/dist/new-widgets/templatesDependencies/formMinMaxMixin.js +0 -18
  142. package/dist/new-widgets/templatesDependencies/formMixin.js +0 -56
  143. package/dist/new-widgets/templatesDependencies/formNumberMixin.js +0 -10
  144. package/dist/new-widgets/templatesDependencies/formRadioMixin.js +0 -12
  145. package/dist/new-widgets/templatesDependencies/formStepMixin.js +0 -12
  146. package/dist/new-widgets/templatesDependencies/linkTextMixin.js +0 -13
  147. package/dist/new-widgets/templatesDependencies/multipleFormMixin.js +0 -116
  148. package/dist/new-widgets/templatesDependencies/multipleselectFormMixin.js +0 -74
  149. package/dist/new-widgets/templatesDependencies/patternMixin.js +0 -18
  150. package/dist/new-widgets/templatesDependencies/rangeMixin.js +0 -100
  151. package/dist/new-widgets/templatesDependencies/setMixin.js +0 -9
  152. package/dist/new-widgets/templatesDependencies/valueRichtextMixin.js +0 -9
  153. package/dist/new-widgets/valueTransformationMixins/autolinkMixin.js +0 -14
  154. package/dist/new-widgets/valueTransformationMixins/dateMixin.js +0 -29
  155. package/dist/new-widgets/valueTransformationMixins/dateTimeMixin.js +0 -12
  156. package/dist/new-widgets/valueTransformationMixins/index.js +0 -15
  157. package/dist/new-widgets/valueTransformationMixins/markdownMixin.js +0 -30
  158. package/dist/new-widgets/valueTransformationMixins/multilineMixin.js +0 -13
  159. package/dist/new-widgets/valueTransformationMixins/oembedMixin.js +0 -21
  160. package/dist/solid-template-element.js +0 -144
  161. package/dist/style/default-theme.css.proxy.js +0 -10
  162. package/dist/widgets/baseWidget.js +0 -267
  163. package/dist/widgets/widget-factory.js +0 -20
  164. /package/dist/{style/default-theme.css → assets/default-theme-d0f20a8a.css} +0 -0
  165. /package/dist/{_snowpack/pkg/quill/dist/quill.snow.css → assets/quill.snow-8f222e44.css} +0 -0
  166. /package/dist/{new-widgets/callbackMixins/slimselect.css → assets/slimselect-43e3ebc8.css} +0 -0
@@ -1,185 +0,0 @@
1
- import Fuse from "../_snowpack/pkg/fusejs.js";
2
- function uniqID() {
3
- return '_' + (Math.random() * Math.pow(36, 20)).toString(36).slice(0, 10);
4
- }
5
- function stringToDom(html) {
6
- const template = document.createElement('template');
7
- template.innerHTML = html;
8
- return template.content;
9
- }
10
- async function evalTemplateString(str, variables = {}) {
11
- const keys = Object.keys(variables);
12
- const values = keys.map(key => variables[key]);
13
- try {
14
- const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor;
15
- const func = AsyncFunction.call(null, ...keys, 'return `' + str + '`');
16
- return await func(...values);
17
- } catch (e) {
18
- console.log(e);
19
- throw new SyntaxError('`' + str + '`');
20
- }
21
- }
22
- function importCSS(...stylesheets) {
23
- const linksElements = [];
24
- for (let url of stylesheets) {
25
- url = relativeSource(url);
26
- let link = Array.from(document.head.querySelectorAll('link')).find(link => link.href === url);
27
- if (link) return link;
28
- link = document.createElement('link');
29
- link.rel = 'stylesheet';
30
- link.href = url;
31
- document.head.appendChild(link);
32
- linksElements.push(link);
33
- }
34
- ;
35
- return linksElements;
36
- }
37
- function importJS(...plugins) {
38
- return plugins.map(url => {
39
- url = new URL(url, document.baseURI).href;
40
- let script = Array.from(document.querySelectorAll('script')).find(script => script.src === url);
41
- if (script) return script;
42
- script = document.createElement('script');
43
- script.src = url;
44
- document.head.appendChild(script);
45
- return script;
46
- });
47
- }
48
- function relativeSource(source) {
49
- if (!source.match(/^\..?\//)) return new URL(source, document.baseURI).href;
50
- const e = new Error();
51
- if (!e.stack) return source;
52
- const f2 = e.stack.split('\n').filter(l => l.includes(':'))[2];
53
- let line = f2.match(/[a-z]+:.*$/);
54
- if (!line) return source;
55
- const calledFile = line[0].replace(/(\:[0-9]+){2}\)?$/, '');
56
- source = new URL(source, calledFile).href;
57
- return source;
58
- }
59
- function loadScript(source) {
60
- source = relativeSource(source);
61
- return new Promise(resolve => {
62
- var script = document.createElement('script');
63
- var head = document.querySelector('head');
64
- script.async = true;
65
- script.onload = () => setTimeout(resolve, 0);
66
- script.src = source;
67
- if (head) head.appendChild(script);
68
- });
69
- }
70
- function domIsReady() {
71
- return new Promise(function (resolve) {
72
- if (document.readyState === 'complete') {
73
- resolve();
74
- } else {
75
- document.addEventListener('DOMContentLoaded', () => resolve());
76
- }
77
- });
78
- }
79
- function setDeepProperty(obj, path, value) {
80
- const name = path.shift();
81
- if (name) {
82
- if (!(name in obj)) obj[name] = {};
83
- if (path.length) setDeepProperty(obj[name], path, value);else obj[name] = value;
84
- }
85
- }
86
- function parseFieldsString(fields) {
87
- let fieldsArray;
88
-
89
- // remove all sets from fields
90
- while (fields.indexOf('(') > 0) {
91
- let firstBracket = fields.indexOf('(');
92
- let noset = fields.substring(firstBracket, findClosingBracketMatchIndex(fields, firstBracket) + 1);
93
- fields = fields.replace(noset, '');
94
- }
95
- const re = /((^\s*|,)\s*)(("(\\"|[^"])*")|('(\\'|[^'])*')|[^,]*)/gm; // match , not inside quotes
96
- fieldsArray = fields.match(re) || []; // separate fields
97
- if (!fieldsArray) return [];
98
- return fieldsArray.map(a => a.replace(/^[\s,]+/, '')); // remove commas and spaces
99
- }
100
-
101
- function findClosingBracketMatchIndex(str, pos) {
102
- if (str[pos] != '(') throw new Error("No '(' at index " + pos);
103
- let depth = 1;
104
- for (let i = pos + 1; i < str.length; i++) {
105
- switch (str[i]) {
106
- case '(':
107
- depth++;
108
- break;
109
- case ')':
110
- if (--depth == 0) return i;
111
- break;
112
- }
113
- }
114
- return -1;
115
- }
116
- function defineComponent(tagName, componentClass) {
117
- if (!customElements.get(tagName)) {
118
- customElements.define(tagName, componentClass);
119
- } else {
120
- console.warn(`Warning: the component "${tagName}" has already been loaded in another version of sib-core.`);
121
- }
122
- }
123
- function fuzzyCompare(subject, search) {
124
- const fuse = new Fuse([subject], {
125
- shouldSort: false,
126
- threshold: 0.37
127
- }).search(search);
128
- return fuse.length > 0;
129
- }
130
- const compare = {
131
- string(subject, query) {
132
- if (query === '') return true;
133
- if (subject.toString().toLowerCase().includes(String(query).toLowerCase())) return true;
134
- return fuzzyCompare(subject, query);
135
- },
136
- boolean(subject, query) {
137
- if (!query) return true;
138
- return subject;
139
- },
140
- number(subject, query) {
141
- return subject === query;
142
- },
143
- list(subject, list) {
144
- return list.includes(subject);
145
- },
146
- range(subject, range) {
147
- return (range[0] == null || range[0] === '' || subject >= range[0]) && (range[1] == null || range[1] === '' || subject <= range[1]);
148
- },
149
- resource(subject, query) {
150
- // dropdown default ' - ' option return an empty string
151
- if (query === '') return true;
152
- if (!query['@id']) return false;
153
- const ret = subject['@id'] === query['@id'];
154
- return ret;
155
- }
156
- };
157
- function transformArrayToContainer(resource) {
158
- const newValue = {
159
- ...resource
160
- };
161
- for (let predicate of Object.keys(newValue)) {
162
- // iterate over all properties
163
- const predicateValue = newValue[predicate];
164
- if (!predicateValue || typeof predicateValue !== 'object') continue; // undefined or literal, do nothing
165
- if (['permissions', '@context'].includes(predicate)) continue; // do not transform permissions and context
166
-
167
- // check all keys of nested resource
168
- if (!Array.isArray(predicateValue) && predicateValue['@id']) {
169
- newValue[predicate] = transformArrayToContainer(resource[predicate]);
170
- }
171
-
172
- // for arrays
173
- if (Array.isArray(predicateValue)) {
174
- newValue[predicate] = {
175
- 'ldp:contains': [...predicateValue]
176
- }; // transform to container
177
- newValue[predicate]['ldp:contains'].forEach((childPredicate, index) => {
178
- // and check all nested resources
179
- newValue[predicate]['ldp:contains'][index] = transformArrayToContainer(childPredicate);
180
- });
181
- }
182
- }
183
- return newValue;
184
- }
185
- export { uniqID, stringToDom, evalTemplateString, importCSS, importJS, loadScript, domIsReady, setDeepProperty, parseFieldsString, findClosingBracketMatchIndex, defineComponent, fuzzyCompare, compare, transformArrayToContainer };
@@ -1,6 +0,0 @@
1
- ;
2
- ;
3
- ;
4
- ;
5
- ;
6
- export {};
@@ -1,139 +0,0 @@
1
- /**
2
- * Spread function from open-wc/lit-helpers
3
- * More informations here: https://open-wc.org/developing/lit-helpers.html
4
- */
5
- import { html, directive, noChange } from '../_snowpack/pkg/lit-html.js';
6
- const prevCache = new WeakMap();
7
- export const spread = directive(spreadData => part => {
8
- const prevData = prevCache.get(part);
9
- if (prevData === spreadData) {
10
- return;
11
- }
12
- prevCache.set(part, spreadData);
13
- if (spreadData) {
14
- for (const key in spreadData) {
15
- const value = spreadData[key];
16
- if (value === noChange) continue;
17
- const prefix = key[0];
18
- const {
19
- element
20
- } = part.committer;
21
- if (prefix === '@') {
22
- const prevHandler = prevData && prevData[key];
23
- if (!prevHandler || prevHandler !== value) {
24
- const name = key.slice(1);
25
- if (prevHandler) element.removeEventListener(name, prevHandler);
26
- element.addEventListener(name, value);
27
- }
28
- continue;
29
- }
30
- if (prefix === '.') {
31
- if (!prevData || prevData[key] !== value) {
32
- element[key.slice(1)] = value;
33
- }
34
- continue;
35
- }
36
- if (prefix === '?') {
37
- if (!prevData || prevData[key] !== value) {
38
- const name = key.slice(1);
39
- if (value) {
40
- element.setAttribute(name, '');
41
- } else {
42
- element.removeAttribute(name);
43
- }
44
- }
45
- continue;
46
- }
47
- if (!prevData || prevData[key] !== value) {
48
- if (value != null) {
49
- element.setAttribute(key, String(value));
50
- } else {
51
- element.removeAttribute(key);
52
- }
53
- }
54
- }
55
- }
56
- if (prevData) {
57
- for (const key in prevData) {
58
- if (!spreadData || !(key in spreadData)) {
59
- const prefix = key[0];
60
- const {
61
- element
62
- } = part.committer;
63
- if (prefix === '@') {
64
- element.removeEventListener(key.slice(1), prevData[key]);
65
- continue;
66
- }
67
- if (prefix === '.') {
68
- element[key.slice(1)] = undefined;
69
- continue;
70
- }
71
- if (prefix === '?') {
72
- element.removeAttribute(key.slice(1));
73
- continue;
74
- }
75
- element.removeAttribute(key);
76
- }
77
- }
78
- }
79
- });
80
- function dropIndices(arr, needlessValues) {
81
- const newArr = [];
82
- let j = 0;
83
- for (let i = 0, n = arr.length; i < n; ++i) {
84
- if (needlessValues[j].index === i) {
85
- ++j;
86
- } else {
87
- newArr.push(arr[i]);
88
- }
89
- }
90
- return newArr;
91
- }
92
- const templateStringsCache = new WeakMap();
93
-
94
- // Convert dynamic tags to template strings
95
- // example: <${'div'}>${'this is example'}</${'div'}> => <div>${'this is example'}</div>
96
- export function preHTML(strings, ...values) {
97
- // check cache !important return equal link at first argument
98
- let cachedStrings = templateStringsCache.get(strings);
99
- if (cachedStrings) {
100
- for (let i = 0, n = cachedStrings.length; i < n; ++i) {
101
- const needlessValues = cachedStrings[i].needlessValues;
102
- let isSame = true;
103
- for (let ii = 0, nn = needlessValues.length; ii < nn; ++ii) {
104
- if (values[needlessValues[ii].index] !== needlessValues[ii].value) {
105
- isSame = false;
106
- break;
107
- }
108
- }
109
- if (isSame) {
110
- return html(cachedStrings[i].strings, ...dropIndices(values, needlessValues));
111
- }
112
- }
113
- }
114
- const needlessValues = [];
115
- const newStrings = [];
116
- let str;
117
- for (let i = 0, n = strings.length; i < n; ++i) {
118
- str = strings[i];
119
- while (str[str.length - 1] === '<' // open tag
120
- || str[str.length - 2] === '<' && str[str.length - 1] === '/' // close tag
121
- ) {
122
- needlessValues.push({
123
- value: values[i],
124
- index: i
125
- });
126
- str += values[i] + strings[++i];
127
- }
128
- newStrings.push(str);
129
- }
130
- if (!cachedStrings) {
131
- cachedStrings = [];
132
- templateStringsCache.set(strings, cachedStrings);
133
- }
134
- cachedStrings.push({
135
- strings: newStrings,
136
- needlessValues
137
- });
138
- return html(newStrings, ...dropIndices(values, needlessValues));
139
- }
@@ -1,35 +0,0 @@
1
- // Array.prototype.flat
2
- if (!('flat' in Array.prototype)) {
3
- Object.defineProperty(Array.prototype, 'flat', {
4
- configurable: true,
5
- value: function flat(depth = 1) {
6
- depth = isNaN(depth) ? 1 : Number(depth);
7
- if (depth === 0) return Array.prototype.slice.call(this);
8
- return Array.prototype.reduce.call(this, function (acc, cur) {
9
- if (Array.isArray(cur)) {
10
- acc.push.apply(acc, flat.call(cur, depth - 1));
11
- } else {
12
- acc.push(cur);
13
- }
14
- return acc;
15
- }, []);
16
- },
17
- writable: true
18
- });
19
- }
20
-
21
- // Element.prototype.toggleAttribute
22
- if (!Element.prototype.toggleAttribute) {
23
- Element.prototype.toggleAttribute = function (name, force = undefined) {
24
- if (force !== undefined) force = !!force;
25
- if (this.hasAttribute(name)) {
26
- if (force) return true;
27
- this.removeAttribute(name);
28
- return false;
29
- }
30
- if (force === false) return false;
31
- this.setAttribute(name, '');
32
- return true;
33
- };
34
- }
35
- export {};