qumra-engine 2.0.144 → 2.0.146
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/dist/config/initClient.d.ts +0 -0
- package/dist/config/initClient.js +46 -0
- package/dist/config/logger.d.ts +0 -0
- package/dist/config/logger.js +75 -0
- package/dist/controllers/article/create-comment.controller.d.ts +2 -0
- package/dist/controllers/article/create-comment.controller.js +17 -0
- package/dist/controllers/auth/activate-password-backignore.controller.d.ts +2 -0
- package/dist/controllers/auth/activate-password-backignore.controller.js +25 -0
- package/dist/controllers/auth/create-customer.controller.d.ts +2 -0
- package/dist/controllers/auth/create-customer.controller.js +24 -0
- package/dist/controllers/auth/customer-address.controller.d.ts +2 -0
- package/dist/controllers/auth/customer-address.controller.js +20 -0
- package/dist/controllers/auth/customer-login-verify.controller.d.ts +2 -0
- package/dist/controllers/auth/customer-login-verify.controller.js +21 -0
- package/dist/controllers/auth/customer-login.controller.d.ts +2 -0
- package/dist/controllers/auth/customer-login.controller.js +23 -0
- package/dist/controllers/auth/customer.controller.d.ts +2 -0
- package/dist/controllers/auth/customer.controller.js +25 -0
- package/dist/controllers/auth/guest-login-backignore.controller.d.ts +2 -0
- package/dist/controllers/auth/guest-login-backignore.controller.js +25 -0
- package/dist/controllers/auth/recover-password-backignore.controller.d.ts +2 -0
- package/dist/controllers/auth/recover-password-backignore.controller.js +26 -0
- package/dist/controllers/auth/reset-password-backignore.controller.d.ts +2 -0
- package/dist/controllers/auth/reset-password-backignore.controller.js +25 -0
- package/dist/controllers/auth/storefront-password-backignore.controller.d.ts +2 -0
- package/dist/controllers/auth/storefront-password-backignore.controller.js +25 -0
- package/dist/controllers/cart/add-to-cart.controller.d.ts +2 -0
- package/dist/controllers/cart/add-to-cart.controller.js +20 -0
- package/dist/controllers/cart/update-cart.controller.d.ts +2 -0
- package/dist/controllers/cart/update-cart.controller.js +26 -0
- package/dist/controllers/checkout/checkout.controller.d.ts +2 -0
- package/dist/controllers/checkout/checkout.controller.js +23 -0
- package/dist/controllers/contact/contact.controller.d.ts +2 -0
- package/dist/controllers/contact/contact.controller.js +20 -0
- package/dist/controllers/localize/currency.controller.d.ts +2 -0
- package/dist/controllers/localize/currency.controller.js +17 -0
- package/dist/controllers/localize/lang.controller.d.ts +2 -0
- package/dist/controllers/localize/lang.controller.js +18 -0
- package/dist/controllers/localize/market.controller.d.ts +2 -0
- package/dist/controllers/localize/market.controller.js +17 -0
- package/dist/extensions/Iteration/break.d.ts +9 -0
- package/dist/extensions/Iteration/break.js +23 -0
- package/dist/extensions/Iteration/continue.d.ts +2 -0
- package/dist/extensions/Iteration/continue.js +10 -0
- package/dist/extensions/{logic/form.d.ts → Iteration/cycle.d.ts} +1 -2
- package/dist/extensions/Iteration/cycle.js +26 -0
- package/dist/extensions/Iteration/forx.d.ts +6 -0
- package/dist/extensions/Iteration/forx.js +69 -0
- package/dist/extensions/Iteration/index.d.ts +2 -0
- package/dist/extensions/Iteration/index.js +10 -0
- package/dist/extensions/html/form.d.ts +13 -0
- package/dist/extensions/html/form.js +77 -0
- package/dist/extensions/html/index.d.ts +2 -0
- package/dist/extensions/html/index.js +10 -0
- package/dist/extensions/html/style.d.ts +7 -0
- package/dist/extensions/html/style.js +26 -0
- package/dist/extensions/index.d.ts +3 -11
- package/dist/extensions/index.js +16 -25
- package/dist/extensions/logic/all_products.d.ts +6 -0
- package/dist/extensions/logic/all_products.js +55 -0
- package/dist/extensions/logic/content.js +3 -0
- package/dist/extensions/logic/echo.d.ts +7 -0
- package/dist/extensions/logic/echo.js +22 -0
- package/dist/extensions/logic/index.d.ts +12 -0
- package/dist/extensions/logic/index.js +31 -0
- package/dist/extensions/logic/log.d.ts +6 -0
- package/dist/extensions/logic/log.js +26 -0
- package/dist/extensions/logic/seo.js +0 -2
- package/dist/extensions/logic/template.js +3 -0
- package/dist/extensions/logic/ui.js +4 -1
- package/dist/extensions/registerAllExtensions.d.ts +1 -1
- package/dist/extensions/registerAllExtensions.js +7 -5
- package/dist/filters/index.d.ts +10 -10
- package/dist/filters/index.js +25 -21
- package/dist/filters/logic/array/find_index.d.ts +1 -0
- package/dist/filters/logic/array/find_index.js +8 -0
- package/dist/filters/logic/array/has.d.ts +1 -0
- package/dist/filters/logic/array/has.js +9 -0
- package/dist/filters/logic/array/index.d.ts +19 -0
- package/dist/filters/logic/array/index.js +44 -0
- package/dist/filters/logic/array/map.d.ts +1 -0
- package/dist/filters/logic/array/map.js +9 -0
- package/dist/filters/logic/array/reject.d.ts +1 -0
- package/dist/filters/logic/array/reject.js +15 -0
- package/dist/filters/logic/array/reverse.d.ts +1 -0
- package/dist/filters/logic/array/reverse.js +9 -0
- package/dist/filters/logic/array/sort.d.ts +1 -0
- package/dist/filters/logic/array/sort.js +20 -0
- package/dist/filters/logic/array/sort_natural.d.ts +1 -0
- package/dist/filters/logic/array/sort_natural.js +20 -0
- package/dist/filters/logic/array/sum.d.ts +1 -0
- package/dist/filters/logic/array/sum.js +9 -0
- package/dist/filters/logic/array/uniq.d.ts +1 -0
- package/dist/filters/logic/array/uniq.js +9 -0
- package/dist/filters/logic/array/uniq_by.d.ts +1 -0
- package/dist/filters/logic/array/uniq_by.js +29 -0
- package/dist/filters/logic/cart/index.d.ts +2 -0
- package/dist/filters/logic/cart/index.js +10 -0
- package/dist/filters/logic/cart/item_count_for_variant.d.ts +1 -0
- package/dist/filters/logic/cart/item_count_for_variant.js +11 -0
- package/dist/filters/logic/cart/line_items_for.d.ts +1 -0
- package/dist/filters/logic/cart/line_items_for.js +15 -0
- package/dist/filters/logic/colors/brightness_difference.d.ts +1 -0
- package/dist/filters/logic/colors/brightness_difference.js +12 -0
- package/dist/filters/logic/colors/color_brightness.d.ts +1 -0
- package/dist/filters/logic/colors/color_brightness.js +7 -0
- package/dist/filters/logic/colors/color_contrast.d.ts +1 -0
- package/dist/filters/logic/colors/color_contrast.js +12 -0
- package/dist/filters/logic/colors/color_darken.d.ts +1 -0
- package/dist/filters/logic/colors/color_darken.js +7 -0
- package/dist/filters/logic/colors/color_desaturate.d.ts +1 -0
- package/dist/filters/logic/colors/color_desaturate.js +7 -0
- package/dist/filters/logic/colors/color_difference.d.ts +1 -0
- package/dist/filters/logic/colors/color_difference.js +12 -0
- package/dist/filters/logic/colors/color_extract.d.ts +1 -0
- package/dist/filters/logic/colors/color_extract.js +22 -0
- package/dist/filters/logic/colors/color_lighten.d.ts +1 -0
- package/dist/filters/logic/colors/color_lighten.js +7 -0
- package/dist/filters/logic/colors/color_mix.d.ts +1 -0
- package/dist/filters/logic/colors/color_mix.js +12 -0
- package/dist/filters/logic/colors/color_modify.d.ts +1 -0
- package/dist/filters/logic/colors/color_modify.js +26 -0
- package/dist/filters/logic/colors/color_saturate.d.ts +1 -0
- package/dist/filters/logic/colors/color_saturate.js +7 -0
- package/dist/filters/logic/colors/color_to_hsl.d.ts +1 -0
- package/dist/filters/logic/colors/color_to_hsl.js +7 -0
- package/dist/filters/logic/colors/color_to_oklch.d.ts +1 -0
- package/dist/filters/logic/colors/color_to_oklch.js +12 -0
- package/dist/filters/logic/colors/color_to_rgb.d.ts +1 -0
- package/dist/filters/logic/colors/color_to_rgb.js +7 -0
- package/dist/filters/logic/colors/hex_to_rgba.d.ts +1 -0
- package/dist/filters/logic/colors/hex_to_rgba.js +7 -0
- package/dist/filters/logic/colors/index.d.ts +16 -0
- package/dist/filters/logic/colors/index.js +38 -0
- package/dist/filters/logic/customer/customer_login_link.d.ts +2 -0
- package/dist/filters/logic/customer/customer_login_link.js +10 -0
- package/dist/filters/logic/customer/customer_logout_link.d.ts +2 -0
- package/dist/filters/logic/customer/customer_logout_link.js +10 -0
- package/dist/filters/logic/customer/customer_register_link.d.ts +2 -0
- package/dist/filters/logic/customer/customer_register_link.js +10 -0
- package/dist/filters/logic/customer/index.d.ts +4 -0
- package/dist/filters/logic/customer/index.js +14 -0
- package/dist/filters/logic/customer/login_button.d.ts +7 -0
- package/dist/filters/logic/customer/login_button.js +39 -0
- package/dist/filters/logic/default/default_pagination.d.ts +10 -0
- package/dist/filters/logic/default/default_pagination.js +41 -0
- package/dist/filters/logic/default/index.d.ts +1 -0
- package/dist/filters/logic/default/index.js +8 -0
- package/dist/filters/logic/format/date.d.ts +1 -0
- package/dist/filters/logic/format/date.js +13 -0
- package/dist/filters/logic/format/index.d.ts +4 -0
- package/dist/filters/logic/format/index.js +14 -0
- package/dist/filters/logic/format/structured_data.d.ts +2 -0
- package/dist/filters/logic/format/structured_data.js +11 -0
- package/dist/filters/logic/format/unit_price_with_measurement.d.ts +1 -0
- package/dist/filters/logic/format/unit_price_with_measurement.js +9 -0
- package/dist/filters/logic/format/weight_with_unit.d.ts +1 -0
- package/dist/filters/logic/format/weight_with_unit.js +12 -0
- package/dist/filters/logic/html/highlight.d.ts +1 -0
- package/dist/filters/logic/html/highlight.js +22 -0
- package/dist/filters/logic/html/index.d.ts +7 -0
- package/dist/filters/logic/html/index.js +20 -0
- package/dist/filters/logic/html/link_to.d.ts +8 -0
- package/dist/filters/logic/html/link_to.js +30 -0
- package/dist/filters/logic/html/placeholder_svg_tag.d.ts +7 -0
- package/dist/filters/logic/html/placeholder_svg_tag.js +28 -0
- package/dist/filters/logic/html/preload_tag.d.ts +7 -0
- package/dist/filters/logic/html/preload_tag.js +27 -0
- package/dist/filters/logic/html/script_tag.d.ts +7 -0
- package/dist/filters/logic/html/script_tag.js +30 -0
- package/dist/filters/logic/html/stylesheet_tag.d.ts +8 -0
- package/dist/filters/logic/html/stylesheet_tag.js +29 -0
- package/dist/filters/logic/html/time_tag.d.ts +7 -0
- package/dist/filters/logic/html/time_tag.js +28 -0
- package/dist/filters/logic/localization/currency_selector.d.ts +7 -0
- package/dist/filters/logic/localization/currency_selector.js +54 -0
- package/dist/filters/logic/localization/format_address.d.ts +13 -0
- package/dist/filters/logic/localization/format_address.js +51 -0
- package/dist/filters/logic/localization/index.d.ts +2 -0
- package/dist/filters/logic/localization/index.js +10 -0
- package/dist/filters/logic/math/abs.d.ts +1 -0
- package/dist/filters/logic/math/abs.js +9 -0
- package/dist/filters/logic/math/at_least.d.ts +1 -0
- package/dist/filters/logic/math/at_least.js +10 -0
- package/dist/filters/logic/math/at_most.d.ts +1 -0
- package/dist/filters/logic/math/at_most.js +10 -0
- package/dist/filters/logic/math/ceil.d.ts +1 -0
- package/dist/filters/logic/math/ceil.js +9 -0
- package/dist/filters/logic/math/divided_by.d.ts +1 -0
- package/dist/filters/logic/math/divided_by.js +10 -0
- package/dist/filters/logic/math/floor.d.ts +1 -0
- package/dist/filters/logic/math/floor.js +9 -0
- package/dist/filters/logic/math/index.d.ts +11 -0
- package/dist/filters/logic/math/index.js +28 -0
- package/dist/filters/logic/math/minus.d.ts +1 -0
- package/dist/filters/logic/math/minus.js +10 -0
- package/dist/filters/logic/math/modulo.d.ts +1 -0
- package/dist/filters/logic/math/modulo.js +10 -0
- package/dist/filters/logic/math/plus.d.ts +1 -0
- package/dist/filters/logic/math/plus.js +10 -0
- package/dist/filters/logic/math/round.d.ts +1 -0
- package/dist/filters/logic/math/round.js +10 -0
- package/dist/filters/logic/math/times.d.ts +1 -0
- package/dist/filters/logic/math/times.js +10 -0
- package/dist/filters/logic/media/external_video_tag.d.ts +11 -0
- package/dist/filters/logic/media/external_video_tag.js +16 -0
- package/dist/filters/logic/media/external_video_url.d.ts +6 -0
- package/dist/filters/logic/media/external_video_url.js +12 -0
- package/dist/filters/logic/media/image_tag.d.ts +11 -0
- package/dist/filters/logic/media/image_tag.js +30 -0
- package/dist/filters/logic/media/image_url.d.ts +9 -0
- package/dist/filters/logic/media/image_url.js +8 -0
- package/dist/filters/logic/media/index.d.ts +8 -0
- package/dist/filters/logic/media/index.js +22 -0
- package/dist/filters/logic/media/media_tag.d.ts +8 -0
- package/dist/filters/logic/media/media_tag.js +25 -0
- package/dist/filters/logic/media/model_viewer_tag.d.ts +7 -0
- package/dist/filters/logic/media/model_viewer_tag.js +14 -0
- package/dist/filters/logic/media/video_tag.d.ts +11 -0
- package/dist/filters/logic/media/video_tag.js +14 -0
- package/dist/filters/logic/syntax/echo.d.ts +1 -0
- package/dist/filters/logic/syntax/echo.js +8 -0
- package/dist/functions/set-optional-param.d.ts +1 -0
- package/dist/functions/set-optional-param.js +11 -0
- package/dist/globals/index.d.ts +1 -0
- package/dist/globals/index.js +3 -1
- package/dist/globals/logic/all_products.d.ts +7 -0
- package/dist/globals/logic/all_products.js +43 -0
- package/dist/graphql/index.d.ts +3 -0
- package/dist/graphql/index.js +40 -0
- package/dist/graphql/mutation/createCustomerAddresses.d.ts +2 -0
- package/dist/graphql/mutation/createCustomerAddresses.js +32 -0
- package/dist/graphql/mutation/customerLogin.d.ts +2 -0
- package/dist/graphql/mutation/customerLogin.js +11 -0
- package/dist/graphql/mutation/customerSignup.d.ts +2 -0
- package/dist/graphql/mutation/customerSignup.js +10 -0
- package/dist/graphql/mutation/customerVerifyOtp.d.ts +2 -0
- package/dist/graphql/mutation/customerVerifyOtp.js +13 -0
- package/dist/graphql/mutation/index.d.ts +5 -0
- package/dist/graphql/mutation/index.js +14 -0
- package/dist/graphql/query/findAllProducts.d.ts +2 -0
- package/dist/graphql/query/findAllProducts.js +93 -0
- package/dist/graphql/query/index.d.ts +2 -0
- package/dist/graphql/query/index.js +8 -0
- package/dist/index.local.d.ts +1 -0
- package/dist/index.local.js +11 -0
- package/dist/middleware/init.middleware.js +16 -0
- package/dist/middleware/locals.middleware.js +1 -1
- package/dist/middleware/prepareData.middleware.js +13 -17
- package/dist/middleware/render.middleware.js +6 -0
- package/dist/middleware/setGlobals.middleware.js +5 -0
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.js +33 -49
- package/dist/routers/dev/index.js +5 -0
- package/dist/routers/production/auth/index.d.ts +2 -0
- package/dist/routers/production/auth/index.js +16 -0
- package/dist/routers/production/auth/login/index.d.ts +2 -0
- package/dist/routers/production/auth/login/index.js +7 -0
- package/dist/routers/production/auth/logout/index.d.ts +2 -0
- package/dist/routers/production/auth/logout/index.js +8 -0
- package/dist/routers/production/auth/signup/index.d.ts +2 -0
- package/dist/routers/production/auth/signup/index.js +7 -0
- package/dist/routers/production/auth/verify/index.d.ts +2 -0
- package/dist/routers/production/auth/verify/index.js +7 -0
- package/dist/routers/production/cart/add/index.d.ts +2 -0
- package/dist/routers/production/cart/add/index.js +7 -0
- package/dist/routers/production/cart/index.d.ts +2 -0
- package/dist/routers/production/cart/index.js +12 -0
- package/dist/routers/production/cart/update/index.d.ts +2 -0
- package/dist/routers/production/cart/update/index.js +7 -0
- package/dist/routers/production/checkout/buy-now/index.d.ts +2 -0
- package/dist/routers/production/checkout/buy-now/index.js +7 -0
- package/dist/routers/production/checkout/create-order/index.d.ts +2 -0
- package/dist/routers/production/checkout/create-order/index.js +7 -0
- package/dist/routers/production/checkout/index.d.ts +2 -0
- package/dist/routers/production/checkout/index.js +12 -0
- package/dist/routers/production/index.d.ts +2 -0
- package/dist/routers/production/index.js +14 -0
- package/dist/routers/production/localize/currency/index.d.ts +2 -0
- package/dist/routers/production/localize/currency/index.js +7 -0
- package/dist/routers/production/localize/index.d.ts +2 -0
- package/dist/routers/production/localize/index.js +14 -0
- package/dist/routers/production/localize/lang/index.d.ts +2 -0
- package/dist/routers/production/localize/lang/index.js +7 -0
- package/dist/routers/production/localize/market/index.d.ts +2 -0
- package/dist/routers/production/localize/market/index.js +7 -0
- package/dist/utils/axios.d.ts +10 -0
- package/dist/utils/axios.js +25 -0
- package/dist/utils/client.d.ts +2 -0
- package/dist/utils/client.js +23 -0
- package/package.json +6 -1
- package/dist/controllers/auth/login.d.ts +0 -2
- package/dist/controllers/auth/login.js +0 -21
- package/dist/extensions/logic/form.js +0 -41
- package/dist/routers/index.js +0 -10
- /package/dist/controllers/auth/{logout.d.ts → logout.controller.d.ts} +0 -0
- /package/dist/controllers/auth/{logout.js → logout.controller.js} +0 -0
- /package/dist/routers/{index.d.ts → dev/index.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function hex_to_rgba(hex: string, alpha: number): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { default as brightness_difference } from './brightness_difference';
|
|
2
|
+
export { default as color_brightness } from './color_brightness';
|
|
3
|
+
export { default as color_contrast } from './color_contrast';
|
|
4
|
+
export { default as color_darken } from './color_darken';
|
|
5
|
+
export { default as color_desaturate } from './color_desaturate';
|
|
6
|
+
export { default as color_difference } from './color_difference';
|
|
7
|
+
export { default as color_extract } from './color_extract';
|
|
8
|
+
export { default as color_lighten } from './color_lighten';
|
|
9
|
+
export { default as color_mix } from './color_mix';
|
|
10
|
+
export { default as color_modify } from './color_modify';
|
|
11
|
+
export { default as color_saturate } from './color_saturate';
|
|
12
|
+
export { default as color_to_hex } from './color_to_hex';
|
|
13
|
+
export { default as color_to_hsl } from './color_to_hsl';
|
|
14
|
+
export { default as color_to_oklch } from './color_to_oklch';
|
|
15
|
+
export { default as color_to_rgb } from './color_to_rgb';
|
|
16
|
+
export { default as hex_to_rgba } from './hex_to_rgba';
|
|
@@ -0,0 +1,38 @@
|
|
|
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.hex_to_rgba = exports.color_to_rgb = exports.color_to_oklch = exports.color_to_hsl = exports.color_to_hex = exports.color_saturate = exports.color_modify = exports.color_mix = exports.color_lighten = exports.color_extract = exports.color_difference = exports.color_desaturate = exports.color_darken = exports.color_contrast = exports.color_brightness = exports.brightness_difference = void 0;
|
|
7
|
+
var brightness_difference_1 = require("./brightness_difference");
|
|
8
|
+
Object.defineProperty(exports, "brightness_difference", { enumerable: true, get: function () { return __importDefault(brightness_difference_1).default; } });
|
|
9
|
+
var color_brightness_1 = require("./color_brightness");
|
|
10
|
+
Object.defineProperty(exports, "color_brightness", { enumerable: true, get: function () { return __importDefault(color_brightness_1).default; } });
|
|
11
|
+
var color_contrast_1 = require("./color_contrast");
|
|
12
|
+
Object.defineProperty(exports, "color_contrast", { enumerable: true, get: function () { return __importDefault(color_contrast_1).default; } });
|
|
13
|
+
var color_darken_1 = require("./color_darken");
|
|
14
|
+
Object.defineProperty(exports, "color_darken", { enumerable: true, get: function () { return __importDefault(color_darken_1).default; } });
|
|
15
|
+
var color_desaturate_1 = require("./color_desaturate");
|
|
16
|
+
Object.defineProperty(exports, "color_desaturate", { enumerable: true, get: function () { return __importDefault(color_desaturate_1).default; } });
|
|
17
|
+
var color_difference_1 = require("./color_difference");
|
|
18
|
+
Object.defineProperty(exports, "color_difference", { enumerable: true, get: function () { return __importDefault(color_difference_1).default; } });
|
|
19
|
+
var color_extract_1 = require("./color_extract");
|
|
20
|
+
Object.defineProperty(exports, "color_extract", { enumerable: true, get: function () { return __importDefault(color_extract_1).default; } });
|
|
21
|
+
var color_lighten_1 = require("./color_lighten");
|
|
22
|
+
Object.defineProperty(exports, "color_lighten", { enumerable: true, get: function () { return __importDefault(color_lighten_1).default; } });
|
|
23
|
+
var color_mix_1 = require("./color_mix");
|
|
24
|
+
Object.defineProperty(exports, "color_mix", { enumerable: true, get: function () { return __importDefault(color_mix_1).default; } });
|
|
25
|
+
var color_modify_1 = require("./color_modify");
|
|
26
|
+
Object.defineProperty(exports, "color_modify", { enumerable: true, get: function () { return __importDefault(color_modify_1).default; } });
|
|
27
|
+
var color_saturate_1 = require("./color_saturate");
|
|
28
|
+
Object.defineProperty(exports, "color_saturate", { enumerable: true, get: function () { return __importDefault(color_saturate_1).default; } });
|
|
29
|
+
var color_to_hex_1 = require("./color_to_hex");
|
|
30
|
+
Object.defineProperty(exports, "color_to_hex", { enumerable: true, get: function () { return __importDefault(color_to_hex_1).default; } });
|
|
31
|
+
var color_to_hsl_1 = require("./color_to_hsl");
|
|
32
|
+
Object.defineProperty(exports, "color_to_hsl", { enumerable: true, get: function () { return __importDefault(color_to_hsl_1).default; } });
|
|
33
|
+
var color_to_oklch_1 = require("./color_to_oklch");
|
|
34
|
+
Object.defineProperty(exports, "color_to_oklch", { enumerable: true, get: function () { return __importDefault(color_to_oklch_1).default; } });
|
|
35
|
+
var color_to_rgb_1 = require("./color_to_rgb");
|
|
36
|
+
Object.defineProperty(exports, "color_to_rgb", { enumerable: true, get: function () { return __importDefault(color_to_rgb_1).default; } });
|
|
37
|
+
var hex_to_rgba_1 = require("./hex_to_rgba");
|
|
38
|
+
Object.defineProperty(exports, "hex_to_rgba", { enumerable: true, get: function () { return __importDefault(hex_to_rgba_1).default; } });
|
|
@@ -0,0 +1,10 @@
|
|
|
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.default = customer_login_link;
|
|
7
|
+
const nunjucks_1 = __importDefault(require("nunjucks"));
|
|
8
|
+
function customer_login_link(text) {
|
|
9
|
+
return new nunjucks_1.default.runtime.SafeString(`<a href="/account/login" id="customer_login_link">${text}</a>`);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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.default = customer_logout_link;
|
|
7
|
+
const nunjucks_1 = __importDefault(require("nunjucks"));
|
|
8
|
+
function customer_logout_link(text) {
|
|
9
|
+
return new nunjucks_1.default.runtime.SafeString(`<a href="/account/logout" id="customer_login_link">${text}</a>`);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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.default = customer_register_link;
|
|
7
|
+
const nunjucks_1 = __importDefault(require("nunjucks"));
|
|
8
|
+
function customer_register_link(text) {
|
|
9
|
+
return new nunjucks_1.default.runtime.SafeString(`<a href="/account/register" id="customer_register_link">${text}</a>`);
|
|
10
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as customer_login_link } from './customer_login_link';
|
|
2
|
+
export { default as customer_logout_link } from './customer_logout_link';
|
|
3
|
+
export { default as customer_register_link } from './customer_register_link';
|
|
4
|
+
export { default as login_button } from './login_button';
|
|
@@ -0,0 +1,14 @@
|
|
|
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.login_button = exports.customer_register_link = exports.customer_logout_link = exports.customer_login_link = void 0;
|
|
7
|
+
var customer_login_link_1 = require("./customer_login_link");
|
|
8
|
+
Object.defineProperty(exports, "customer_login_link", { enumerable: true, get: function () { return __importDefault(customer_login_link_1).default; } });
|
|
9
|
+
var customer_logout_link_1 = require("./customer_logout_link");
|
|
10
|
+
Object.defineProperty(exports, "customer_logout_link", { enumerable: true, get: function () { return __importDefault(customer_logout_link_1).default; } });
|
|
11
|
+
var customer_register_link_1 = require("./customer_register_link");
|
|
12
|
+
Object.defineProperty(exports, "customer_register_link", { enumerable: true, get: function () { return __importDefault(customer_register_link_1).default; } });
|
|
13
|
+
var login_button_1 = require("./login_button");
|
|
14
|
+
Object.defineProperty(exports, "login_button", { enumerable: true, get: function () { return __importDefault(login_button_1).default; } });
|
|
@@ -0,0 +1,39 @@
|
|
|
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.default = login_button;
|
|
7
|
+
const nunjucks_1 = __importDefault(require("nunjucks"));
|
|
8
|
+
function login_button(shop, action = "default") {
|
|
9
|
+
if (!shop || typeof shop !== "object") {
|
|
10
|
+
console.warn("[login_button] The 'shop' object is required for validation.");
|
|
11
|
+
return new nunjucks_1.default.runtime.SafeString("");
|
|
12
|
+
}
|
|
13
|
+
const buttonText = action === "follow" ? "Follow this shop" : "Sign in with Shop";
|
|
14
|
+
let href = "/account/login";
|
|
15
|
+
if (action === "follow") {
|
|
16
|
+
href = "/account/login?next=follow";
|
|
17
|
+
}
|
|
18
|
+
const html = `
|
|
19
|
+
<a
|
|
20
|
+
href="${href}"
|
|
21
|
+
class="shop-login-button"
|
|
22
|
+
data-action="${action}"
|
|
23
|
+
aria-label="${buttonText}"
|
|
24
|
+
style="
|
|
25
|
+
display:inline-block;
|
|
26
|
+
background:#000;
|
|
27
|
+
color:#fff;
|
|
28
|
+
padding:10px 18px;
|
|
29
|
+
border-radius:6px;
|
|
30
|
+
text-decoration:none;
|
|
31
|
+
font-family:system-ui, sans-serif;
|
|
32
|
+
font-size:14px;
|
|
33
|
+
"
|
|
34
|
+
>
|
|
35
|
+
${buttonText}
|
|
36
|
+
</a>
|
|
37
|
+
`;
|
|
38
|
+
return new nunjucks_1.default.runtime.SafeString(html.trim());
|
|
39
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import nunjucks from "nunjucks";
|
|
2
|
+
interface PaginationInput {
|
|
3
|
+
totalItems: number;
|
|
4
|
+
currentPage: number;
|
|
5
|
+
limit: number;
|
|
6
|
+
hasNextPage: boolean;
|
|
7
|
+
totalPages: number;
|
|
8
|
+
}
|
|
9
|
+
export default function date(data: PaginationInput, ...args: any[]): nunjucks.runtime.SafeString;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
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.default = date;
|
|
7
|
+
const nunjucks_1 = __importDefault(require("nunjucks"));
|
|
8
|
+
function date(data, ...args) {
|
|
9
|
+
if (!data || typeof data !== "object") {
|
|
10
|
+
return new nunjucks_1.default.runtime.SafeString("");
|
|
11
|
+
}
|
|
12
|
+
const options = args.length > 0 && typeof args[args.length - 1] === "object"
|
|
13
|
+
? args[args.length - 1]
|
|
14
|
+
: {};
|
|
15
|
+
const baseUrl = options.baseUrl || "";
|
|
16
|
+
const previousText = options.previous || "Previous";
|
|
17
|
+
const nextText = options.next || "Next";
|
|
18
|
+
const anchor = options.anchor ? `#${options.anchor}` : "";
|
|
19
|
+
const parts = [];
|
|
20
|
+
const { totalPages, currentPage } = data;
|
|
21
|
+
if (currentPage > 1) {
|
|
22
|
+
const prevUrl = `${baseUrl}?page=${currentPage - 1}${anchor}`;
|
|
23
|
+
parts.push(`<span class="prev"><a href="${prevUrl}" title="Page ${currentPage - 1}">${previousText}</a></span>`);
|
|
24
|
+
}
|
|
25
|
+
for (let i = 1; i <= totalPages; i++) {
|
|
26
|
+
const url = `${baseUrl}?page=${i}${anchor}`;
|
|
27
|
+
if (i === currentPage) {
|
|
28
|
+
parts.push(`<span class="page current">${i}</span>`);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
parts.push(`<span class="page"><a href="${url}" title="Page ${i}">${i}</a></span>`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (currentPage < totalPages) {
|
|
35
|
+
const nextUrl = `${baseUrl}?page=${currentPage + 1}${anchor}`;
|
|
36
|
+
parts.push(`<span class="next"><a href="${nextUrl}" title="Page ${currentPage + 1}">${nextText}</a></span>`);
|
|
37
|
+
}
|
|
38
|
+
const html = parts.join(" ");
|
|
39
|
+
const containerHtml = `<nav class="pagination">${html}</nav>`;
|
|
40
|
+
return new nunjucks_1.default.runtime.SafeString(containerHtml);
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as default_pagination } from './default_pagination';
|
|
@@ -0,0 +1,8 @@
|
|
|
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.default_pagination = void 0;
|
|
7
|
+
var default_pagination_1 = require("./default_pagination");
|
|
8
|
+
Object.defineProperty(exports, "default_pagination", { enumerable: true, get: function () { return __importDefault(default_pagination_1).default; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function dateFilter(input: string | number | Date, formatStr: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = dateFilter;
|
|
4
|
+
const date_fns_1 = require("date-fns");
|
|
5
|
+
const locale_1 = require("date-fns/locale");
|
|
6
|
+
function dateFilter(input, formatStr) {
|
|
7
|
+
if (!input || !formatStr)
|
|
8
|
+
return String(input || "");
|
|
9
|
+
const dateObj = new Date(input);
|
|
10
|
+
if (isNaN(dateObj.getTime()))
|
|
11
|
+
return String(input);
|
|
12
|
+
return (0, date_fns_1.format)(dateObj, formatStr, { locale: locale_1.enUS });
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
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.weight_with_unit = exports.unit_price_with_measurement = exports.structured_data = exports.dateFilter = void 0;
|
|
7
|
+
var date_1 = require("./date");
|
|
8
|
+
Object.defineProperty(exports, "dateFilter", { enumerable: true, get: function () { return __importDefault(date_1).default; } });
|
|
9
|
+
var structured_data_1 = require("./structured_data");
|
|
10
|
+
Object.defineProperty(exports, "structured_data", { enumerable: true, get: function () { return __importDefault(structured_data_1).default; } });
|
|
11
|
+
var unit_price_with_measurement_1 = require("./unit_price_with_measurement");
|
|
12
|
+
Object.defineProperty(exports, "unit_price_with_measurement", { enumerable: true, get: function () { return __importDefault(unit_price_with_measurement_1).default; } });
|
|
13
|
+
var weight_with_unit_1 = require("./weight_with_unit");
|
|
14
|
+
Object.defineProperty(exports, "weight_with_unit", { enumerable: true, get: function () { return __importDefault(weight_with_unit_1).default; } });
|
|
@@ -0,0 +1,11 @@
|
|
|
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.default = structured_data;
|
|
7
|
+
const nunjucks_1 = __importDefault(require("nunjucks"));
|
|
8
|
+
function structured_data(data) {
|
|
9
|
+
const jsonString = JSON.stringify(data);
|
|
10
|
+
return new nunjucks_1.default.runtime.SafeString(`<script type="application/ld+json">${jsonString}</script>`);
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function unit_price_with_measurement(price: string, currency?: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = unit_price_with_measurement;
|
|
4
|
+
const locals_1 = require("../../../store/locals");
|
|
5
|
+
function unit_price_with_measurement(price, currency) {
|
|
6
|
+
const cookiesCurrency = (0, locals_1.getLocales)("cookies").currency;
|
|
7
|
+
const parsePrice = parseFloat(price);
|
|
8
|
+
return `${parsePrice} ${cookiesCurrency ?? currency}`;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function weight_with_unit(weight: number, unit?: 'g' | 'kg'): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = weight_with_unit;
|
|
4
|
+
function weight_with_unit(weight, unit) {
|
|
5
|
+
if (weight == null) {
|
|
6
|
+
return '';
|
|
7
|
+
}
|
|
8
|
+
if (unit === 'kg' || (!unit && weight >= 1000)) {
|
|
9
|
+
return `${(weight / 1000).toFixed(2)} kg`;
|
|
10
|
+
}
|
|
11
|
+
return `${weight} g`;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function highlight(text: string, terms: string | string[]): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = highlight;
|
|
4
|
+
function highlight(text, terms) {
|
|
5
|
+
if (!text || !terms)
|
|
6
|
+
return text || '';
|
|
7
|
+
let termArr = [];
|
|
8
|
+
if (Array.isArray(terms)) {
|
|
9
|
+
termArr = terms.filter(Boolean);
|
|
10
|
+
}
|
|
11
|
+
else if (typeof terms === 'string') {
|
|
12
|
+
termArr = terms
|
|
13
|
+
.split(/\s+/)
|
|
14
|
+
.filter(Boolean);
|
|
15
|
+
}
|
|
16
|
+
if (termArr.length === 0)
|
|
17
|
+
return text;
|
|
18
|
+
termArr.sort((a, b) => b.length - a.length);
|
|
19
|
+
const escapedTerms = termArr.map(t => t.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'));
|
|
20
|
+
const regex = new RegExp(`(${escapedTerms.join('|')})`, 'gi');
|
|
21
|
+
return text.replace(regex, '<strong class="highlight">$1</strong>');
|
|
22
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as highlight } from './highlight';
|
|
2
|
+
export { default as link_to } from './link_to';
|
|
3
|
+
export { default as preload_tag } from './preload_tag';
|
|
4
|
+
export { default as script_tag } from './script_tag';
|
|
5
|
+
export { default as stylesheet_tag } from './stylesheet_tag';
|
|
6
|
+
export { default as placeholder_svg_tag } from './placeholder_svg_tag';
|
|
7
|
+
export { default as time_tag } from './time_tag';
|
|
@@ -0,0 +1,20 @@
|
|
|
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.time_tag = exports.placeholder_svg_tag = exports.stylesheet_tag = exports.script_tag = exports.preload_tag = exports.link_to = exports.highlight = void 0;
|
|
7
|
+
var highlight_1 = require("./highlight");
|
|
8
|
+
Object.defineProperty(exports, "highlight", { enumerable: true, get: function () { return __importDefault(highlight_1).default; } });
|
|
9
|
+
var link_to_1 = require("./link_to");
|
|
10
|
+
Object.defineProperty(exports, "link_to", { enumerable: true, get: function () { return __importDefault(link_to_1).default; } });
|
|
11
|
+
var preload_tag_1 = require("./preload_tag");
|
|
12
|
+
Object.defineProperty(exports, "preload_tag", { enumerable: true, get: function () { return __importDefault(preload_tag_1).default; } });
|
|
13
|
+
var script_tag_1 = require("./script_tag");
|
|
14
|
+
Object.defineProperty(exports, "script_tag", { enumerable: true, get: function () { return __importDefault(script_tag_1).default; } });
|
|
15
|
+
var stylesheet_tag_1 = require("./stylesheet_tag");
|
|
16
|
+
Object.defineProperty(exports, "stylesheet_tag", { enumerable: true, get: function () { return __importDefault(stylesheet_tag_1).default; } });
|
|
17
|
+
var placeholder_svg_tag_1 = require("./placeholder_svg_tag");
|
|
18
|
+
Object.defineProperty(exports, "placeholder_svg_tag", { enumerable: true, get: function () { return __importDefault(placeholder_svg_tag_1).default; } });
|
|
19
|
+
var time_tag_1 = require("./time_tag");
|
|
20
|
+
Object.defineProperty(exports, "time_tag", { enumerable: true, get: function () { return __importDefault(time_tag_1).default; } });
|
|
@@ -0,0 +1,30 @@
|
|
|
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.default = link_to;
|
|
7
|
+
const nunjucks_1 = __importDefault(require("nunjucks"));
|
|
8
|
+
function link_to(text, url, options = {}) {
|
|
9
|
+
if (!text || !url)
|
|
10
|
+
return new nunjucks_1.default.runtime.SafeString(text || '');
|
|
11
|
+
const rel = options.rel !== undefined ? options.rel : 'nofollow';
|
|
12
|
+
let attrs = `href="${escapeHtml(url)}" rel="${escapeHtml(rel)}"`;
|
|
13
|
+
if (options.class) {
|
|
14
|
+
attrs += ` class="${escapeHtml(options.class)}"`;
|
|
15
|
+
}
|
|
16
|
+
for (const [key, value] of Object.entries(options)) {
|
|
17
|
+
if (key !== 'rel' && key !== 'class' && value !== undefined && value !== null) {
|
|
18
|
+
attrs += ` ${escapeHtml(key)}="${escapeHtml(String(value))}"`;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return new nunjucks_1.default.runtime.SafeString(`<a ${attrs}>${escapeHtml(text)}</a>`);
|
|
22
|
+
}
|
|
23
|
+
function escapeHtml(str) {
|
|
24
|
+
return str
|
|
25
|
+
.replace(/&/g, "&")
|
|
26
|
+
.replace(/"/g, """)
|
|
27
|
+
.replace(/'/g, "'")
|
|
28
|
+
.replace(/</g, "<")
|
|
29
|
+
.replace(/>/g, ">");
|
|
30
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.default = placeholder_svg_tag;
|
|
7
|
+
const nunjucks_1 = __importDefault(require("nunjucks"));
|
|
8
|
+
function escapeHtml(str) {
|
|
9
|
+
if (typeof str !== 'string')
|
|
10
|
+
return '';
|
|
11
|
+
return str
|
|
12
|
+
.replace(/&/g, "&")
|
|
13
|
+
.replace(/"/g, """)
|
|
14
|
+
.replace(/'/g, "'")
|
|
15
|
+
.replace(/</g, "<")
|
|
16
|
+
.replace(/>/g, ">");
|
|
17
|
+
}
|
|
18
|
+
function placeholder_svg_tag(name, options = {}) {
|
|
19
|
+
const { class: customClass, ...otherOptions } = options;
|
|
20
|
+
const finalClass = `placeholder-svg${customClass ? ` ${escapeHtml(customClass)}` : ''}`;
|
|
21
|
+
let attrs = `class="${finalClass}"`;
|
|
22
|
+
for (const [key, value] of Object.entries(otherOptions)) {
|
|
23
|
+
attrs += ` ${escapeHtml(key)}="${escapeHtml(String(value))}"`;
|
|
24
|
+
}
|
|
25
|
+
const svgContent = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500"><title>${escapeHtml(name)}</title></svg>`;
|
|
26
|
+
const dataUri = `data:image/svg+xml;base64,${Buffer.from(svgContent).toString('base64')}`;
|
|
27
|
+
return new nunjucks_1.default.runtime.SafeString(`<img src="${dataUri}" alt="${escapeHtml(name)}" ${attrs}>`);
|
|
28
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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.default = preload_tag;
|
|
7
|
+
const nunjucks_1 = __importDefault(require("nunjucks"));
|
|
8
|
+
function escapeHtml(str) {
|
|
9
|
+
if (typeof str !== 'string')
|
|
10
|
+
return '';
|
|
11
|
+
return str
|
|
12
|
+
.replace(/&/g, "&")
|
|
13
|
+
.replace(/"/g, """)
|
|
14
|
+
.replace(/'/g, "'")
|
|
15
|
+
.replace(/</g, "<")
|
|
16
|
+
.replace(/>/g, ">");
|
|
17
|
+
}
|
|
18
|
+
function preload_tag(url, options = {}) {
|
|
19
|
+
if (!url) {
|
|
20
|
+
return new nunjucks_1.default.runtime.SafeString('');
|
|
21
|
+
}
|
|
22
|
+
let attrs = `href="${escapeHtml(url)}" rel="preload"`;
|
|
23
|
+
for (const [key, value] of Object.entries(options)) {
|
|
24
|
+
attrs += ` ${escapeHtml(key)}="${escapeHtml(String(value))}"`;
|
|
25
|
+
}
|
|
26
|
+
return new nunjucks_1.default.runtime.SafeString(`<link ${attrs}>`);
|
|
27
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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.default = script_tag;
|
|
7
|
+
const nunjucks_1 = __importDefault(require("nunjucks"));
|
|
8
|
+
function escapeHtml(str) {
|
|
9
|
+
if (typeof str !== 'string')
|
|
10
|
+
return '';
|
|
11
|
+
return str
|
|
12
|
+
.replace(/&/g, "&")
|
|
13
|
+
.replace(/"/g, """)
|
|
14
|
+
.replace(/'/g, "'")
|
|
15
|
+
.replace(/</g, "<")
|
|
16
|
+
.replace(/>/g, ">");
|
|
17
|
+
}
|
|
18
|
+
function script_tag(url, options = {}) {
|
|
19
|
+
if (!url) {
|
|
20
|
+
return new nunjucks_1.default.runtime.SafeString('');
|
|
21
|
+
}
|
|
22
|
+
const type = options.type || 'text/javascript';
|
|
23
|
+
let attrs = `src="${escapeHtml(url)}" type="${escapeHtml(type)}"`;
|
|
24
|
+
for (const [key, value] of Object.entries(options)) {
|
|
25
|
+
if (key !== 'type' && value !== undefined && value !== null && value !== false) {
|
|
26
|
+
attrs += ` ${escapeHtml(key)}="${escapeHtml(String(value))}"`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return new nunjucks_1.default.runtime.SafeString(`<script ${attrs}></script>`);
|
|
30
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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.default = stylesheet_tag;
|
|
7
|
+
const nunjucks_1 = __importDefault(require("nunjucks"));
|
|
8
|
+
function escapeHtml(str) {
|
|
9
|
+
if (typeof str !== 'string')
|
|
10
|
+
return '';
|
|
11
|
+
return str
|
|
12
|
+
.replace(/&/g, "&")
|
|
13
|
+
.replace(/"/g, """)
|
|
14
|
+
.replace(/'/g, "'")
|
|
15
|
+
.replace(/</g, "<")
|
|
16
|
+
.replace(/>/g, ">");
|
|
17
|
+
}
|
|
18
|
+
function stylesheet_tag(url, options = {}) {
|
|
19
|
+
if (!url) {
|
|
20
|
+
return new nunjucks_1.default.runtime.SafeString('');
|
|
21
|
+
}
|
|
22
|
+
let attrs = `href="${escapeHtml(url)}" rel="${options.rel || 'stylesheet'}"`;
|
|
23
|
+
for (const [key, value] of Object.entries(options)) {
|
|
24
|
+
if (key !== 'rel' && value !== undefined && value !== null && value !== false) {
|
|
25
|
+
attrs += ` ${escapeHtml(key)}="${escapeHtml(String(value))}"`;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return new nunjucks_1.default.runtime.SafeString(`<link ${attrs}>`);
|
|
29
|
+
}
|