@salla.sa/twilight 1.6.15 → 2.0.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/README.md +4 -214
- package/components/README.md +55 -0
- package/components/dist/cjs/index-9441fd8e.js +1554 -0
- package/components/dist/cjs/index.cjs.js +2 -0
- package/components/dist/cjs/loader.cjs.js +21 -0
- package/components/dist/cjs/salla-login_2.cjs.entry.js +131 -0
- package/components/dist/cjs/twilight-components.cjs.js +19 -0
- package/components/dist/collection/collection-manifest.json +13 -0
- package/components/dist/collection/components/generate-summary.js +35 -0
- package/components/dist/collection/components/salla-login/salla-login.css +104 -0
- package/components/dist/collection/components/salla-login/salla-login.js +113 -0
- package/components/dist/collection/components/search-modal/search-modal.css +9 -0
- package/components/dist/collection/components/search-modal/search-modal.js +161 -0
- package/components/dist/collection/index.js +1 -0
- package/components/dist/collection/interfaces/colors.js +1 -0
- package/components/dist/collection/interfaces/index.js +2 -0
- package/components/dist/collection/interfaces/ratio.js +1 -0
- package/components/dist/collection/plugins/tailwind-theme/index.js +32 -0
- package/components/dist/collection/plugins/tailwind-theme/scripts/generator.js +51 -0
- package/components/dist/collection/utils/utils.js +16 -0
- package/components/dist/esm/index-63e5409f.js +1527 -0
- package/components/dist/esm/index.js +1 -0
- package/components/dist/esm/loader.js +17 -0
- package/components/dist/esm/polyfills/core-js.js +11 -0
- package/components/dist/esm/polyfills/css-shim.js +1 -0
- package/components/dist/esm/polyfills/dom.js +79 -0
- package/components/dist/esm/polyfills/es5-html-element.js +1 -0
- package/components/dist/esm/polyfills/index.js +34 -0
- package/components/dist/esm/polyfills/system.js +6 -0
- package/components/dist/esm/salla-login_2.entry.js +126 -0
- package/components/dist/esm/twilight-components.js +17 -0
- package/components/dist/index.cjs.js +1 -0
- package/components/dist/index.js +1 -0
- package/components/dist/twilight-components/index.esm.js +0 -0
- package/components/dist/twilight-components/p-3d53781c.js +1 -0
- package/components/dist/twilight-components/p-fccb89fa.entry.js +1 -0
- package/components/dist/twilight-components/twilight-components.esm.js +1 -0
- package/components/dist/types/components/salla-login/salla-login.d.ts +14 -0
- package/components/dist/types/components/search-modal/search-modal.d.ts +26 -0
- package/components/dist/types/components.d.ts +76 -0
- package/components/dist/types/index.d.ts +6 -0
- package/components/dist/types/interfaces/colors.d.ts +1 -0
- package/components/dist/types/interfaces/index.d.ts +2 -0
- package/components/dist/types/interfaces/ratio.d.ts +1 -0
- package/components/dist/types/stencil-public-runtime.d.ts +1563 -0
- package/components/dist/types/utils/utils.d.ts +6 -0
- package/components/loader/cdn.js +3 -0
- package/components/loader/index.cjs.js +3 -0
- package/components/loader/index.d.ts +13 -0
- package/components/loader/index.es2017.js +3 -0
- package/components/loader/index.js +4 -0
- package/components/loader/package.json +10 -0
- package/components/package.json +70 -0
- package/components/src/plugins/tailwind-theme/index.js +32 -0
- package/components/src/plugins/tailwind-theme/package.json +27 -0
- package/components/src/plugins/tailwind-theme/readme.md +47 -0
- package/components/src/plugins/tailwind-theme/safe-list-css.txt +19 -0
- package/components/src/plugins/tailwind-theme/utilities.json +1 -0
- package/components.js +1 -0
- package/dist/twilight.js +2 -0
- package/dist/twilight.js.LICENSE.txt +27 -0
- package/package.json +53 -63
- package/postInstall.js +2 -0
- package/tailwind.js +1 -0
- package/tailwind_css_list.js +1 -0
- package/watcher.js +20 -62
- package/LICENSE.md +0 -674
- package/dist/@salla.sa/twilight.min.js +0 -20
- package/dist/@salla.sa/twilight.min.js.map +0 -1
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/index.js.map +0 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -1
- package/types/actions.d.ts +0 -47
- package/types/api/auth/index.d.ts +0 -17
- package/types/api/auth/request.d.ts +0 -42
- package/types/api/auth/response.d.ts +0 -22
- package/types/api/cart/index.d.ts +0 -24
- package/types/api/cart/request.d.ts +0 -8
- package/types/api/cart/response.d.ts +0 -66
- package/types/api/comment.d.ts +0 -18
- package/types/api/currency.d.ts +0 -17
- package/types/api/document.d.ts +0 -3
- package/types/api/index.d.ts +0 -110
- package/types/api/loyalty.d.ts +0 -226
- package/types/api/order.d.ts +0 -15
- package/types/api/product/index.d.ts +0 -17
- package/types/api/product/request.d.ts +0 -53
- package/types/api/product/response.d.ts +0 -103
- package/types/api/profile.d.ts +0 -60
- package/types/api/rating.d.ts +0 -49
- package/types/api/scope.d.ts +0 -42
- package/types/api/wishlist.d.ts +0 -7
- package/types/common.d.ts +0 -75
- package/types/event/auth.d.ts +0 -18
- package/types/event/cart.d.ts +0 -30
- package/types/event/comment.d.ts +0 -7
- package/types/event/currency.d.ts +0 -9
- package/types/event/document.d.ts +0 -29
- package/types/event/index.d.ts +0 -48
- package/types/event/infiniteScroll.d.ts +0 -12
- package/types/event/loyalty.d.ts +0 -14
- package/types/event/order.d.ts +0 -11
- package/types/event/product.d.ts +0 -30
- package/types/event/profile.d.ts +0 -19
- package/types/event/rating.d.ts +0 -13
- package/types/event/scope.d.ts +0 -15
- package/types/event/wishlist.d.ts +0 -8
- package/types/helpers/app-helpers.d.ts +0 -29
- package/types/index.d.ts +0 -37
- package/types/lib/config.ts +0 -14
- package/types/lib/form.d.ts +0 -8
- package/types/lib/lang.d.ts +0 -14
- package/types/lib/notify.d.ts +0 -14
- package/types/tiwlight-config.d.ts +0 -74
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var fs = require('fs');
|
|
2
|
+
var path = require('path');
|
|
3
|
+
var _ = require('lodash');
|
|
4
|
+
var components = {};
|
|
5
|
+
fs.readdirSync(path.resolve(__dirname, './../'), {withFileTypes: true}).filter(dirent => dirent.isDirectory()).forEach(directory => {
|
|
6
|
+
try {
|
|
7
|
+
components[directory.name] = JSON.parse(fs.readFileSync(path.resolve(__dirname + '/../' + directory.name, 'utilities.json'), 'UTF-8'));
|
|
8
|
+
} catch (e) {
|
|
9
|
+
// ignore
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var utilities = {};
|
|
14
|
+
|
|
15
|
+
for (const [keyComponent, value] of Object.entries(components)) {
|
|
16
|
+
console.log('> Processing ' + keyComponent + ' ...');
|
|
17
|
+
_.forEach(value, function(value, keyUtility) {
|
|
18
|
+
keyUtility = '.s-' + keyComponent + '-' + keyUtility;
|
|
19
|
+
utilities[keyUtility] = {[`@apply ${value}`]: {}};
|
|
20
|
+
});
|
|
21
|
+
console.log('✓ Processed ' + keyComponent + '');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// write the utilities for the plugin
|
|
25
|
+
console.log('> Write utilities ...');
|
|
26
|
+
fs.writeFileSync(
|
|
27
|
+
path.resolve(__dirname, './../utilities.json'),
|
|
28
|
+
JSON.stringify(utilities),
|
|
29
|
+
function(err) {
|
|
30
|
+
if (err) {
|
|
31
|
+
return console.log(err);
|
|
32
|
+
}
|
|
33
|
+
console.log('The file was saved!');
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
// write the save list css
|
|
39
|
+
console.log('> Write safe-list-css ...');
|
|
40
|
+
fs.writeFileSync(
|
|
41
|
+
path.resolve(__dirname, './../safe-list-css.txt'),
|
|
42
|
+
Object.keys(utilities).map((name) => name.replace('.','')).join('\n'),
|
|
43
|
+
function(err) {
|
|
44
|
+
if (err) {
|
|
45
|
+
return console.log(err);
|
|
46
|
+
}
|
|
47
|
+
console.log('The file was saved!');
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
console.log('✓ Done ...');
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function format(first, middle, last) {
|
|
2
|
+
return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
|
|
3
|
+
}
|
|
4
|
+
export const toInteger = (value, defaultValue = NaN) => {
|
|
5
|
+
const integer = parseInt(value, 10);
|
|
6
|
+
return isNaN(integer) ? defaultValue : integer;
|
|
7
|
+
};
|
|
8
|
+
export const validateInput = event => {
|
|
9
|
+
const isValid = true;
|
|
10
|
+
const errors = [];
|
|
11
|
+
// check if email or url matched
|
|
12
|
+
if (event.target.validity.typeMismatch) {
|
|
13
|
+
errors.push('mismatched');
|
|
14
|
+
}
|
|
15
|
+
return { isValid, errors };
|
|
16
|
+
};
|