@salla.sa/twilight-components 1.0.12 → 1.0.13

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 (82) hide show
  1. package/dist/{esm → twilight-components}/Helper-81ac9a8c.js +0 -0
  2. package/dist/twilight-components/app-globals-0f993ce5.js +3 -0
  3. package/dist/twilight-components/css-shim-a64b8820.js +4 -0
  4. package/dist/twilight-components/dom-d08ba8aa.js +73 -0
  5. package/dist/twilight-components/index-8cf58712.js +3010 -0
  6. package/dist/twilight-components/index.esm.js +3 -1
  7. package/dist/twilight-components/multi-warehouse.entry.js +89 -0
  8. package/dist/twilight-components/salla-button.entry.js +70 -0
  9. package/dist/{esm → twilight-components}/salla-localization.entry.js +8 -7
  10. package/dist/{esm/salla-login-0e85b2d8.js → twilight-components/salla-login-97e0a9ab.js} +1 -1
  11. package/dist/twilight-components/salla-login.entry.js +2 -0
  12. package/dist/twilight-components/salla-modal.entry.js +85 -0
  13. package/dist/{esm → twilight-components}/salla-product-availability.entry.js +12 -15
  14. package/dist/{esm → twilight-components}/salla-rating.entry.js +17 -17
  15. package/dist/{esm/salla-search-615b8f94.js → twilight-components/salla-search-df1c9b54.js} +1 -1
  16. package/dist/twilight-components/salla-search.entry.js +2 -0
  17. package/dist/{esm → twilight-components}/salla-verify.entry.js +1 -1
  18. package/dist/twilight-components/shadow-css-bc14d9fd.js +389 -0
  19. package/dist/twilight-components/twilight-components.esm.js +125 -1
  20. package/dist/types/components/salla-button/salla-button.d.ts +1 -0
  21. package/dist/types/components/salla-localization/salla-localization.d.ts +2 -2
  22. package/dist/types/components/salla-product-availability/salla-product-availability.d.ts +4 -3
  23. package/dist/types/components.d.ts +14 -10
  24. package/package.json +1 -1
  25. package/dist/cjs/Helper-8852feaa.js +0 -23
  26. package/dist/cjs/index-23da2c6b.js +0 -1601
  27. package/dist/cjs/index.cjs.js +0 -12
  28. package/dist/cjs/loader.cjs.js +0 -21
  29. package/dist/cjs/multi-warehouse_4.cjs.entry.js +0 -242
  30. package/dist/cjs/salla-localization.cjs.entry.js +0 -76
  31. package/dist/cjs/salla-login-476fb312.js +0 -14
  32. package/dist/cjs/salla-product-availability.cjs.entry.js +0 -78
  33. package/dist/cjs/salla-rating.cjs.entry.js +0 -299
  34. package/dist/cjs/salla-search-f9e00be9.js +0 -97
  35. package/dist/cjs/salla-search.cjs.entry.js +0 -10
  36. package/dist/cjs/salla-verify.cjs.entry.js +0 -96
  37. package/dist/cjs/twilight-components.cjs.js +0 -19
  38. package/dist/collection/Helpers/Helper.js +0 -19
  39. package/dist/collection/collection-manifest.json +0 -20
  40. package/dist/collection/components/generate-summary.js +0 -35
  41. package/dist/collection/components/multi-warehouse/multi-warehouse.css +0 -13
  42. package/dist/collection/components/multi-warehouse/multi-warehouse.js +0 -238
  43. package/dist/collection/components/salla-button/salla-button.css +0 -3
  44. package/dist/collection/components/salla-button/salla-button.js +0 -219
  45. package/dist/collection/components/salla-localization/salla-localization.js +0 -201
  46. package/dist/collection/components/salla-login/salla-login.js +0 -31
  47. package/dist/collection/components/salla-modal/salla-modal.js +0 -316
  48. package/dist/collection/components/salla-product-availability/salla-product-availability.js +0 -316
  49. package/dist/collection/components/salla-rating/salla-rating.css +0 -3
  50. package/dist/collection/components/salla-rating/salla-rating.js +0 -484
  51. package/dist/collection/components/salla-search/salla-search.js +0 -155
  52. package/dist/collection/components/salla-verify/salla-verify.js +0 -99
  53. package/dist/collection/index.js +0 -2
  54. package/dist/collection/interfaces/colors.js +0 -1
  55. package/dist/collection/interfaces/index.js +0 -2
  56. package/dist/collection/interfaces/ratio.js +0 -1
  57. package/dist/collection/plugins/tailwind-theme/generator.js +0 -53
  58. package/dist/collection/plugins/tailwind-theme/index.js +0 -26
  59. package/dist/esm/index-643344dc.js +0 -1573
  60. package/dist/esm/index.js +0 -3
  61. package/dist/esm/loader.js +0 -17
  62. package/dist/esm/multi-warehouse_4.entry.js +0 -235
  63. package/dist/esm/polyfills/core-js.js +0 -11
  64. package/dist/esm/polyfills/css-shim.js +0 -1
  65. package/dist/esm/polyfills/dom.js +0 -79
  66. package/dist/esm/polyfills/es5-html-element.js +0 -1
  67. package/dist/esm/polyfills/index.js +0 -34
  68. package/dist/esm/polyfills/system.js +0 -6
  69. package/dist/esm/salla-search.entry.js +0 -2
  70. package/dist/esm/twilight-components.js +0 -17
  71. package/dist/index.cjs.js +0 -1
  72. package/dist/index.js +0 -1
  73. package/dist/twilight-components/p-2b8a5fa4.entry.js +0 -1
  74. package/dist/twilight-components/p-36c87e2e.js +0 -1
  75. package/dist/twilight-components/p-4e37a6cb.entry.js +0 -1
  76. package/dist/twilight-components/p-751643d8.entry.js +0 -1
  77. package/dist/twilight-components/p-8a2410e6.js +0 -1
  78. package/dist/twilight-components/p-94b18718.entry.js +0 -1
  79. package/dist/twilight-components/p-9bc28e0c.js +0 -1
  80. package/dist/twilight-components/p-bb503365.entry.js +0 -1
  81. package/dist/twilight-components/p-d1ef2268.js +0 -1
  82. package/dist/twilight-components/p-d34bbfc4.entry.js +0 -1
@@ -0,0 +1,389 @@
1
+ /*
2
+ Stencil Client Platform v2.8.1 | MIT Licensed | https://stenciljs.com
3
+ */
4
+ /**
5
+ * @license
6
+ * Copyright Google Inc. All Rights Reserved.
7
+ *
8
+ * Use of this source code is governed by an MIT-style license that can be
9
+ * found in the LICENSE file at https://angular.io/license
10
+ *
11
+ * This file is a port of shadowCSS from webcomponents.js to TypeScript.
12
+ * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
13
+ * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
14
+ */
15
+ const safeSelector = (selector) => {
16
+ const placeholders = [];
17
+ let index = 0;
18
+ let content;
19
+ // Replaces attribute selectors with placeholders.
20
+ // The WS in [attr="va lue"] would otherwise be interpreted as a selector separator.
21
+ selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => {
22
+ const replaceBy = `__ph-${index}__`;
23
+ placeholders.push(keep);
24
+ index++;
25
+ return replaceBy;
26
+ });
27
+ // Replaces the expression in `:nth-child(2n + 1)` with a placeholder.
28
+ // WS and "+" would otherwise be interpreted as selector separators.
29
+ content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
30
+ const replaceBy = `__ph-${index}__`;
31
+ placeholders.push(exp);
32
+ index++;
33
+ return pseudo + replaceBy;
34
+ });
35
+ const ss = {
36
+ content,
37
+ placeholders,
38
+ };
39
+ return ss;
40
+ };
41
+ const restoreSafeSelector = (placeholders, content) => {
42
+ return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]);
43
+ };
44
+ const _polyfillHost = '-shadowcsshost';
45
+ const _polyfillSlotted = '-shadowcssslotted';
46
+ // note: :host-context pre-processed to -shadowcsshostcontext.
47
+ const _polyfillHostContext = '-shadowcsscontext';
48
+ const _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)';
49
+ const _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim');
50
+ const _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim');
51
+ const _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim');
52
+ const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
53
+ const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
54
+ const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
55
+ const _selectorReSuffix = '([>\\s~+[.,{:][\\s\\S]*)?$';
56
+ const _polyfillHostRe = /-shadowcsshost/gim;
57
+ const _colonHostRe = /:host/gim;
58
+ const _colonSlottedRe = /::slotted/gim;
59
+ const _colonHostContextRe = /:host-context/gim;
60
+ const _commentRe = /\/\*\s*[\s\S]*?\*\//g;
61
+ const stripComments = (input) => {
62
+ return input.replace(_commentRe, '');
63
+ };
64
+ const _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;
65
+ const extractCommentsWithHash = (input) => {
66
+ return input.match(_commentWithHashRe) || [];
67
+ };
68
+ const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
69
+ const _curlyRe = /([{}])/g;
70
+ const OPEN_CURLY = '{';
71
+ const CLOSE_CURLY = '}';
72
+ const BLOCK_PLACEHOLDER = '%BLOCK%';
73
+ const processRules = (input, ruleCallback) => {
74
+ const inputWithEscapedBlocks = escapeBlocks(input);
75
+ let nextBlockIndex = 0;
76
+ return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
77
+ const selector = m[2];
78
+ let content = '';
79
+ let suffix = m[4];
80
+ let contentPrefix = '';
81
+ if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {
82
+ content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
83
+ suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
84
+ contentPrefix = '{';
85
+ }
86
+ const cssRule = {
87
+ selector,
88
+ content,
89
+ };
90
+ const rule = ruleCallback(cssRule);
91
+ return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
92
+ });
93
+ };
94
+ const escapeBlocks = (input) => {
95
+ const inputParts = input.split(_curlyRe);
96
+ const resultParts = [];
97
+ const escapedBlocks = [];
98
+ let bracketCount = 0;
99
+ let currentBlockParts = [];
100
+ for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {
101
+ const part = inputParts[partIndex];
102
+ if (part === CLOSE_CURLY) {
103
+ bracketCount--;
104
+ }
105
+ if (bracketCount > 0) {
106
+ currentBlockParts.push(part);
107
+ }
108
+ else {
109
+ if (currentBlockParts.length > 0) {
110
+ escapedBlocks.push(currentBlockParts.join(''));
111
+ resultParts.push(BLOCK_PLACEHOLDER);
112
+ currentBlockParts = [];
113
+ }
114
+ resultParts.push(part);
115
+ }
116
+ if (part === OPEN_CURLY) {
117
+ bracketCount++;
118
+ }
119
+ }
120
+ if (currentBlockParts.length > 0) {
121
+ escapedBlocks.push(currentBlockParts.join(''));
122
+ resultParts.push(BLOCK_PLACEHOLDER);
123
+ }
124
+ const strEscapedBlocks = {
125
+ escapedString: resultParts.join(''),
126
+ blocks: escapedBlocks,
127
+ };
128
+ return strEscapedBlocks;
129
+ };
130
+ const insertPolyfillHostInCssText = (selector) => {
131
+ selector = selector
132
+ .replace(_colonHostContextRe, _polyfillHostContext)
133
+ .replace(_colonHostRe, _polyfillHost)
134
+ .replace(_colonSlottedRe, _polyfillSlotted);
135
+ return selector;
136
+ };
137
+ const convertColonRule = (cssText, regExp, partReplacer) => {
138
+ // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule
139
+ return cssText.replace(regExp, (...m) => {
140
+ if (m[2]) {
141
+ const parts = m[2].split(',');
142
+ const r = [];
143
+ for (let i = 0; i < parts.length; i++) {
144
+ const p = parts[i].trim();
145
+ if (!p)
146
+ break;
147
+ r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
148
+ }
149
+ return r.join(',');
150
+ }
151
+ else {
152
+ return _polyfillHostNoCombinator + m[3];
153
+ }
154
+ });
155
+ };
156
+ const colonHostPartReplacer = (host, part, suffix) => {
157
+ return host + part.replace(_polyfillHost, '') + suffix;
158
+ };
159
+ const convertColonHost = (cssText) => {
160
+ return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);
161
+ };
162
+ const colonHostContextPartReplacer = (host, part, suffix) => {
163
+ if (part.indexOf(_polyfillHost) > -1) {
164
+ return colonHostPartReplacer(host, part, suffix);
165
+ }
166
+ else {
167
+ return host + part + suffix + ', ' + part + ' ' + host + suffix;
168
+ }
169
+ };
170
+ const convertColonSlotted = (cssText, slotScopeId) => {
171
+ const slotClass = '.' + slotScopeId + ' > ';
172
+ const selectors = [];
173
+ cssText = cssText.replace(_cssColonSlottedRe, (...m) => {
174
+ if (m[2]) {
175
+ const compound = m[2].trim();
176
+ const suffix = m[3];
177
+ const slottedSelector = slotClass + compound + suffix;
178
+ let prefixSelector = '';
179
+ for (let i = m[4] - 1; i >= 0; i--) {
180
+ const char = m[5][i];
181
+ if (char === '}' || char === ',') {
182
+ break;
183
+ }
184
+ prefixSelector = char + prefixSelector;
185
+ }
186
+ const orgSelector = prefixSelector + slottedSelector;
187
+ const addedSelector = `${prefixSelector.trimRight()}${slottedSelector.trim()}`;
188
+ if (orgSelector.trim() !== addedSelector.trim()) {
189
+ const updatedSelector = `${addedSelector}, ${orgSelector}`;
190
+ selectors.push({
191
+ orgSelector,
192
+ updatedSelector,
193
+ });
194
+ }
195
+ return slottedSelector;
196
+ }
197
+ else {
198
+ return _polyfillHostNoCombinator + m[3];
199
+ }
200
+ });
201
+ return {
202
+ selectors,
203
+ cssText,
204
+ };
205
+ };
206
+ const convertColonHostContext = (cssText) => {
207
+ return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);
208
+ };
209
+ const convertShadowDOMSelectors = (cssText) => {
210
+ return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText);
211
+ };
212
+ const makeScopeMatcher = (scopeSelector) => {
213
+ const lre = /\[/g;
214
+ const rre = /\]/g;
215
+ scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]');
216
+ return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');
217
+ };
218
+ const selectorNeedsScoping = (selector, scopeSelector) => {
219
+ const re = makeScopeMatcher(scopeSelector);
220
+ return !re.test(selector);
221
+ };
222
+ const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => {
223
+ // In Android browser, the lastIndex is not reset when the regex is used in String.replace()
224
+ _polyfillHostRe.lastIndex = 0;
225
+ if (_polyfillHostRe.test(selector)) {
226
+ const replaceBy = `.${hostSelector}`;
227
+ return selector
228
+ .replace(_polyfillHostNoCombinatorRe, (_, selector) => {
229
+ return selector.replace(/([^:]*)(:*)(.*)/, (_, before, colon, after) => {
230
+ return before + replaceBy + colon + after;
231
+ });
232
+ })
233
+ .replace(_polyfillHostRe, replaceBy + ' ');
234
+ }
235
+ return scopeSelector + ' ' + selector;
236
+ };
237
+ const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => {
238
+ const isRe = /\[is=([^\]]*)\]/g;
239
+ scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
240
+ const className = '.' + scopeSelector;
241
+ const _scopeSelectorPart = (p) => {
242
+ let scopedP = p.trim();
243
+ if (!scopedP) {
244
+ return '';
245
+ }
246
+ if (p.indexOf(_polyfillHostNoCombinator) > -1) {
247
+ scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector);
248
+ }
249
+ else {
250
+ // remove :host since it should be unnecessary
251
+ const t = p.replace(_polyfillHostRe, '');
252
+ if (t.length > 0) {
253
+ const matches = t.match(/([^:]*)(:*)(.*)/);
254
+ if (matches) {
255
+ scopedP = matches[1] + className + matches[2] + matches[3];
256
+ }
257
+ }
258
+ }
259
+ return scopedP;
260
+ };
261
+ const safeContent = safeSelector(selector);
262
+ selector = safeContent.content;
263
+ let scopedSelector = '';
264
+ let startIndex = 0;
265
+ let res;
266
+ const sep = /( |>|\+|~(?!=))\s*/g;
267
+ // If a selector appears before :host it should not be shimmed as it
268
+ // matches on ancestor elements and not on elements in the host's shadow
269
+ // `:host-context(div)` is transformed to
270
+ // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`
271
+ // the `div` is not part of the component in the 2nd selectors and should not be scoped.
272
+ // Historically `component-tag:host` was matching the component so we also want to preserve
273
+ // this behavior to avoid breaking legacy apps (it should not match).
274
+ // The behavior should be:
275
+ // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)
276
+ // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a
277
+ // `:host-context(tag)`)
278
+ const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
279
+ // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present
280
+ let shouldScope = !hasHost;
281
+ while ((res = sep.exec(selector)) !== null) {
282
+ const separator = res[1];
283
+ const part = selector.slice(startIndex, res.index).trim();
284
+ shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
285
+ const scopedPart = shouldScope ? _scopeSelectorPart(part) : part;
286
+ scopedSelector += `${scopedPart} ${separator} `;
287
+ startIndex = sep.lastIndex;
288
+ }
289
+ const part = selector.substring(startIndex);
290
+ shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
291
+ scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
292
+ // replace the placeholders with their original values
293
+ return restoreSafeSelector(safeContent.placeholders, scopedSelector);
294
+ };
295
+ const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {
296
+ return selector
297
+ .split(',')
298
+ .map((shallowPart) => {
299
+ if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) {
300
+ return shallowPart.trim();
301
+ }
302
+ if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {
303
+ return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();
304
+ }
305
+ else {
306
+ return shallowPart.trim();
307
+ }
308
+ })
309
+ .join(', ');
310
+ };
311
+ const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
312
+ return processRules(cssText, (rule) => {
313
+ let selector = rule.selector;
314
+ let content = rule.content;
315
+ if (rule.selector[0] !== '@') {
316
+ selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
317
+ }
318
+ else if (rule.selector.startsWith('@media') ||
319
+ rule.selector.startsWith('@supports') ||
320
+ rule.selector.startsWith('@page') ||
321
+ rule.selector.startsWith('@document')) {
322
+ content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector);
323
+ }
324
+ const cssRule = {
325
+ selector: selector.replace(/\s{2,}/g, ' ').trim(),
326
+ content,
327
+ };
328
+ return cssRule;
329
+ });
330
+ };
331
+ const scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => {
332
+ cssText = insertPolyfillHostInCssText(cssText);
333
+ cssText = convertColonHost(cssText);
334
+ cssText = convertColonHostContext(cssText);
335
+ const slotted = convertColonSlotted(cssText, slotScopeId);
336
+ cssText = slotted.cssText;
337
+ cssText = convertShadowDOMSelectors(cssText);
338
+ if (scopeId) {
339
+ cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId);
340
+ }
341
+ cssText = cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);
342
+ cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 ');
343
+ return {
344
+ cssText: cssText.trim(),
345
+ slottedSelectors: slotted.selectors,
346
+ };
347
+ };
348
+ const scopeCss = (cssText, scopeId, commentOriginalSelector) => {
349
+ const hostScopeId = scopeId + '-h';
350
+ const slotScopeId = scopeId + '-s';
351
+ const commentsWithHash = extractCommentsWithHash(cssText);
352
+ cssText = stripComments(cssText);
353
+ const orgSelectors = [];
354
+ if (commentOriginalSelector) {
355
+ const processCommentedSelector = (rule) => {
356
+ const placeholder = `/*!@___${orgSelectors.length}___*/`;
357
+ const comment = `/*!@${rule.selector}*/`;
358
+ orgSelectors.push({ placeholder, comment });
359
+ rule.selector = placeholder + rule.selector;
360
+ return rule;
361
+ };
362
+ cssText = processRules(cssText, (rule) => {
363
+ if (rule.selector[0] !== '@') {
364
+ return processCommentedSelector(rule);
365
+ }
366
+ else if (rule.selector.startsWith('@media') ||
367
+ rule.selector.startsWith('@supports') ||
368
+ rule.selector.startsWith('@page') ||
369
+ rule.selector.startsWith('@document')) {
370
+ rule.content = processRules(rule.content, processCommentedSelector);
371
+ return rule;
372
+ }
373
+ return rule;
374
+ });
375
+ }
376
+ const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId);
377
+ cssText = [scoped.cssText, ...commentsWithHash].join('\n');
378
+ if (commentOriginalSelector) {
379
+ orgSelectors.forEach(({ placeholder, comment }) => {
380
+ cssText = cssText.replace(placeholder, comment);
381
+ });
382
+ }
383
+ scoped.slottedSelectors.forEach((slottedSelector) => {
384
+ cssText = cssText.replace(slottedSelector.orgSelector, slottedSelector.updatedSelector);
385
+ });
386
+ return cssText;
387
+ };
388
+
389
+ export { scopeCss };
@@ -1 +1,125 @@
1
- import{p as e,b as s}from"./p-d1ef2268.js";(()=>{const s=import.meta.url,l={};return""!==s&&(l.resourcesUrl=new URL(".",s).href),e(l)})().then((e=>s([["p-d34bbfc4",[[4,"multi-warehouse",{position:[1],displayAs:[1,"display-as"],browseProductsFrom:[1,"browse-products-from"],branches:[16],current:[1026],open:[32],selected:[32],isOpenedBefore:[32],show:[64],hide:[64]}],[0,"salla-login"],[4,"salla-button",{btnStyle:[513,"btn-style"],loading:[516],disabled:[516],loaderPosition:[1,"loader-position"],load:[64],stop:[64],disable:[64],enable:[64]}],[4,"salla-modal",{error:[4],success:[4],isClosable:[1028,"is-closable"],modalWidth:[513,"modal-width"],visible:[516],subTitle:[1,"sub-title"],icon:[1],show:[64],hide:[64],setTitle:[64]}]]],["p-bb503365",[[4,"salla-localization",{languages:[1],currencies:[1],ok:[1],show:[64],hide:[64],submit:[64]}]]],["p-2b8a5fa4",[[4,"salla-product-availability",{channels:[1],buttonText:[1,"button-text"],countryCode:[1,"country-code"],subscribe:[1],cancel:[1],subTitle:[1,"sub-title"],mobileLabel:[1,"mobile-label"],emailLabel:[1,"email-label"],mobilePlaceholder:[1,"mobile-placeholder"],emailPlaceholder:[1,"email-placeholder"],productId:[2,"product-id"],subscribed:[1],submit:[64]}]]],["p-94b18718",[[0,"salla-rating",{orderId:[2,"order-id"],thanksMsg:[1,"thanks-msg"],isStoreRating:[4,"is-store-rating"],isProductsRating:[4,"is-products-rating"],isShippingRating:[4,"is-shipping-rating"],show:[64],hide:[64]}]]],["p-4e37a6cb",[[0,"salla-verify"]]],["p-751643d8",[[4,"salla-search",{searchPlaceholder:[1,"search-placeholder"],noResultsText:[1,"no-results-text"],searchTerm:[32],results:[32],fetchStatus:[32],showResult:[32],showModal:[32]}]]]],e)));
1
+ import { B as BUILD, c as consoleDevInfo, p as plt, w as win, H, d as doc, N as NAMESPACE, a as promiseResolve, b as bootstrapLazy } from './index-8cf58712.js';
2
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
3
+
4
+ /*
5
+ Stencil Client Patch Browser v2.8.1 | MIT Licensed | https://stenciljs.com
6
+ */
7
+ const getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`;
8
+ const patchBrowser = () => {
9
+ // NOTE!! This fn cannot use async/await!
10
+ if (BUILD.isDev && !BUILD.isTesting) {
11
+ consoleDevInfo('Running in development mode.');
12
+ }
13
+ if (BUILD.cssVarShim) {
14
+ // shim css vars
15
+ plt.$cssShim$ = win.__cssshim;
16
+ }
17
+ if (BUILD.cloneNodeFix) {
18
+ // opted-in to polyfill cloneNode() for slot polyfilled components
19
+ patchCloneNodeFix(H.prototype);
20
+ }
21
+ if (BUILD.profile && !performance.mark) {
22
+ // not all browsers support performance.mark/measure (Safari 10)
23
+ performance.mark = performance.measure = () => {
24
+ /*noop*/
25
+ };
26
+ performance.getEntriesByName = () => [];
27
+ }
28
+ // @ts-ignore
29
+ const scriptElm = BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim
30
+ ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\/${NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) ||
31
+ s.getAttribute('data-stencil-namespace') === NAMESPACE)
32
+ : null;
33
+ const importMeta = import.meta.url;
34
+ const opts = BUILD.scriptDataOpts ? scriptElm['data-opts'] || {} : {};
35
+ if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {
36
+ // Safari < v11 support: This IF is true if it's Safari below v11.
37
+ // This fn cannot use async/await since Safari didn't support it until v11,
38
+ // however, Safari 10 did support modules. Safari 10 also didn't support "nomodule",
39
+ // so both the ESM file and nomodule file would get downloaded. Only Safari
40
+ // has 'onbeforeload' in the script, and "history.scrollRestoration" was added
41
+ // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.
42
+ // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.
43
+ return {
44
+ then() {
45
+ /* promise noop */
46
+ },
47
+ };
48
+ }
49
+ if (!BUILD.safari10 && importMeta !== '') {
50
+ opts.resourcesUrl = new URL('.', importMeta).href;
51
+ }
52
+ else if (BUILD.dynamicImportShim || BUILD.safari10) {
53
+ opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;
54
+ if (BUILD.dynamicImportShim) {
55
+ patchDynamicImport(opts.resourcesUrl, scriptElm);
56
+ }
57
+ if (BUILD.dynamicImportShim && !win.customElements) {
58
+ // module support, but no custom elements support (Old Edge)
59
+ // @ts-ignore
60
+ return import(/* webpackChunkName: "polyfills-dom" */ './dom-d08ba8aa.js').then(() => opts);
61
+ }
62
+ }
63
+ return promiseResolve(opts);
64
+ };
65
+ const patchDynamicImport = (base, orgScriptElm) => {
66
+ const importFunctionName = getDynamicImportFunction(NAMESPACE);
67
+ try {
68
+ // test if this browser supports dynamic imports
69
+ // There is a caching issue in V8, that breaks using import() in Function
70
+ // By generating a random string, we can workaround it
71
+ // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info
72
+ win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);
73
+ }
74
+ catch (e) {
75
+ // this shim is specifically for browsers that do support "esm" imports
76
+ // however, they do NOT support "dynamic" imports
77
+ // basically this code is for old Edge, v18 and below
78
+ const moduleMap = new Map();
79
+ win[importFunctionName] = (src) => {
80
+ const url = new URL(src, base).href;
81
+ let mod = moduleMap.get(url);
82
+ if (!mod) {
83
+ const script = doc.createElement('script');
84
+ script.type = 'module';
85
+ script.crossOrigin = orgScriptElm.crossOrigin;
86
+ script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {
87
+ type: 'application/javascript',
88
+ }));
89
+ mod = new Promise((resolve) => {
90
+ script.onload = () => {
91
+ resolve(win[importFunctionName].m);
92
+ script.remove();
93
+ };
94
+ });
95
+ moduleMap.set(url, mod);
96
+ doc.head.appendChild(script);
97
+ }
98
+ return mod;
99
+ };
100
+ }
101
+ };
102
+ const patchCloneNodeFix = (HTMLElementPrototype) => {
103
+ const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;
104
+ HTMLElementPrototype.cloneNode = function (deep) {
105
+ if (this.nodeName === 'TEMPLATE') {
106
+ return nativeCloneNodeFn.call(this, deep);
107
+ }
108
+ const clonedNode = nativeCloneNodeFn.call(this, false);
109
+ const srcChildNodes = this.childNodes;
110
+ if (deep) {
111
+ for (let i = 0; i < srcChildNodes.length; i++) {
112
+ // Node.ATTRIBUTE_NODE === 2, and checking because IE11
113
+ if (srcChildNodes[i].nodeType !== 2) {
114
+ clonedNode.appendChild(srcChildNodes[i].cloneNode(true));
115
+ }
116
+ }
117
+ }
118
+ return clonedNode;
119
+ };
120
+ };
121
+
122
+ patchBrowser().then(options => {
123
+ globalScripts();
124
+ return bootstrapLazy([["salla-button",[[4,"salla-button",{"btnStyle":[513,"btn-style"],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"load":[64],"stop":[64],"disable":[64],"enable":[64]}]]],["salla-modal",[[4,"salla-modal",{"error":[4],"success":[4],"isClosable":[1028,"is-closable"],"modalWidth":[513,"modal-width"],"visible":[516],"subTitle":[1,"sub-title"],"icon":[1],"show":[64],"hide":[64],"setTitle":[64]}]]],["multi-warehouse",[[4,"multi-warehouse",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}]]],["salla-localization",[[4,"salla-localization",{"languagesTitle":[1,"languages-title"],"currenciesTitle":[1,"currencies-title"],"ok":[1],"show":[64],"hide":[64],"submit":[64]}]]],["salla-product-availability",[[4,"salla-product-availability",{"channels":[1],"buttonText":[1,"button-text"],"countryCode":[1,"country-code"],"subscribeText":[1,"subscribe-text"],"cancelText":[1,"cancel-text"],"subTitle":[1,"sub-title"],"mobileLabel":[1,"mobile-label"],"emailLabel":[1,"email-label"],"mobilePlaceholder":[1,"mobile-placeholder"],"emailPlaceholder":[1,"email-placeholder"],"productId":[2,"product-id"],"subscribedMessage":[1,"subscribed-message"],"isSubscribed":[1028,"is-subscribed"],"submit":[64]}]]],["salla-rating",[[0,"salla-rating",{"orderId":[2,"order-id"],"thanksMsg":[1,"thanks-msg"],"isStoreRating":[4,"is-store-rating"],"isProductsRating":[4,"is-products-rating"],"isShippingRating":[4,"is-shipping-rating"],"show":[64],"hide":[64]}]]],["salla-verify",[[0,"salla-verify"]]],["salla-login",[[0,"salla-login"]]],["salla-search",[[4,"salla-search",{"searchPlaceholder":[1,"search-placeholder"],"noResultsText":[1,"no-results-text"],"searchTerm":[32],"results":[32],"fetchStatus":[32],"showResult":[32],"showModal":[32]}]]]], options);
125
+ });
@@ -5,6 +5,7 @@ export declare class SallaButton {
5
5
  loading: boolean;
6
6
  disabled: boolean;
7
7
  loaderPosition: string;
8
+ wide: boolean;
8
9
  load(): Promise<HTMLElement>;
9
10
  stop(): Promise<HTMLElement>;
10
11
  disable(): Promise<void>;
@@ -6,8 +6,8 @@ export declare class SallaLocalization {
6
6
  private currency;
7
7
  private readonly languageSlot;
8
8
  private readonly currencySlot;
9
- languages: string;
10
- currencies: string;
9
+ languagesTitle: string;
10
+ currenciesTitle: string;
11
11
  ok: string;
12
12
  host: HTMLElement;
13
13
  show(): Promise<HTMLElement>;
@@ -11,15 +11,16 @@ export declare class SallaProductAvailability {
11
11
  channels: string;
12
12
  buttonText: string;
13
13
  countryCode: string;
14
- subscribe: string;
15
- cancel: string;
14
+ subscribeText: string;
15
+ cancelText: string;
16
16
  subTitle: string;
17
17
  mobileLabel: string;
18
18
  emailLabel: string;
19
19
  mobilePlaceholder: string;
20
20
  emailPlaceholder: string;
21
21
  productId: number;
22
- subscribed: string;
22
+ subscribedMessage: string;
23
+ isSubscribed: boolean;
23
24
  channelsWatcher(newValue: any): void;
24
25
  submit(): Promise<any>;
25
26
  render(): any;
@@ -24,11 +24,12 @@ export namespace Components {
24
24
  "loaderPosition": string;
25
25
  "loading": boolean;
26
26
  "stop": () => Promise<HTMLElement>;
27
+ "wide": boolean;
27
28
  }
28
29
  interface SallaLocalization {
29
- "currencies": string;
30
+ "currenciesTitle": string;
30
31
  "hide": () => Promise<HTMLElement>;
31
- "languages": string;
32
+ "languagesTitle": string;
32
33
  "ok": string;
33
34
  "show": () => Promise<HTMLElement>;
34
35
  "submit": () => Promise<void>;
@@ -49,18 +50,19 @@ export namespace Components {
49
50
  }
50
51
  interface SallaProductAvailability {
51
52
  "buttonText": string;
52
- "cancel": string;
53
+ "cancelText": string;
53
54
  "channels": string;
54
55
  "countryCode": string;
55
56
  "emailLabel": string;
56
57
  "emailPlaceholder": string;
58
+ "isSubscribed": boolean;
57
59
  "mobileLabel": string;
58
60
  "mobilePlaceholder": string;
59
61
  "productId": number;
60
62
  "subTitle": string;
61
63
  "submit": () => Promise<any>;
62
- "subscribe": string;
63
- "subscribed": string;
64
+ "subscribeText": string;
65
+ "subscribedMessage": string;
64
66
  }
65
67
  interface SallaRating {
66
68
  "hide": () => Promise<HTMLElement>;
@@ -164,10 +166,11 @@ declare namespace LocalJSX {
164
166
  "disabled"?: boolean;
165
167
  "loaderPosition"?: string;
166
168
  "loading"?: boolean;
169
+ "wide"?: boolean;
167
170
  }
168
171
  interface SallaLocalization {
169
- "currencies"?: string;
170
- "languages"?: string;
172
+ "currenciesTitle"?: string;
173
+ "languagesTitle"?: string;
171
174
  "ok"?: string;
172
175
  }
173
176
  interface SallaLogin {
@@ -185,17 +188,18 @@ declare namespace LocalJSX {
185
188
  }
186
189
  interface SallaProductAvailability {
187
190
  "buttonText"?: string;
188
- "cancel"?: string;
191
+ "cancelText"?: string;
189
192
  "channels"?: string;
190
193
  "countryCode"?: string;
191
194
  "emailLabel"?: string;
192
195
  "emailPlaceholder"?: string;
196
+ "isSubscribed"?: boolean;
193
197
  "mobileLabel"?: string;
194
198
  "mobilePlaceholder"?: string;
195
199
  "productId"?: number;
196
200
  "subTitle"?: string;
197
- "subscribe"?: string;
198
- "subscribed"?: string;
201
+ "subscribeText"?: string;
202
+ "subscribedMessage"?: string;
199
203
  }
200
204
  interface SallaRating {
201
205
  "isProductsRating"?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight-components",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "twilight",
@@ -1,23 +0,0 @@
1
- 'use strict';
2
-
3
- class Helper extends salla.AppHelpers {
4
- setHost(host) {
5
- this.host = host;
6
- }
7
- getElement(selector) {
8
- return this.host.querySelector(selector);
9
- }
10
- getAttribute(selector, attribute) {
11
- var _a;
12
- return (_a = this.getElement(selector)) === null || _a === void 0 ? void 0 : _a.getAttribute(attribute);
13
- }
14
- val(selector) {
15
- return this.getAttribute(selector, 'value');
16
- }
17
- isUser() {
18
- return !!salla.config.is_user;
19
- }
20
- }
21
- const Helper$1 = new Helper;
22
-
23
- exports.Helper = Helper$1;