@evlop/commons 1.0.292 → 1.0.293
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/cjs/src/hooks/useTemplate.d.ts.map +1 -1
- package/dist/cjs/src/hooks/useTemplate.js +3 -8
- package/dist/cjs/src/hooks/useTemplate.js.map +1 -1
- package/dist/esm/src/hooks/useTemplate.d.ts.map +1 -1
- package/dist/esm/src/hooks/useTemplate.js +4 -9
- package/dist/esm/src/hooks/useTemplate.js.map +1 -1
- package/dist/types/src/hooks/useTemplate.d.ts.map +1 -1
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTemplate.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTemplate.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"useTemplate.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTemplate.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,oBAAqB,MAAM,QAqBlD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
@@ -4,16 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
exports.useTemplate = void 0;
|
7
|
+
const handlebars_min_js_1 = __importDefault(require("handlebars/dist/handlebars.min.js"));
|
8
|
+
const lodash_1 = require("lodash");
|
7
9
|
const react_1 = require("react");
|
8
10
|
const useScope_1 = require("./useScope");
|
9
|
-
const
|
10
|
-
const uuid_1 = require("uuid");
|
11
|
-
const handlebars_min_js_1 = __importDefault(require("handlebars/dist/handlebars.min.js"));
|
12
|
-
const handlebarsCompile = lodash_1.memoize((stringValue) => handlebars_min_js_1.default.compile(stringValue, { noEscape: true }), (stringValue) => {
|
13
|
-
if (lodash_1.size(stringValue) < 100)
|
14
|
-
return stringValue;
|
15
|
-
return uuid_1.v5(stringValue, '060c30f4-309d-4054-a62e-7d7390c63cce');
|
16
|
-
});
|
11
|
+
const handlebarsCompile = lodash_1.memoize((stringValue) => handlebars_min_js_1.default.compile(stringValue, { noEscape: true }));
|
17
12
|
const useTemplate = (templateString) => {
|
18
13
|
const scope = useScope_1.useScope();
|
19
14
|
const applyTemplate = react_1.useCallback((stringValue) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTemplate.js","sourceRoot":"","sources":["../../../../src/hooks/useTemplate.tsx"],"names":[],"mappings":";;;;;;AAAA,
|
1
|
+
{"version":3,"file":"useTemplate.js","sourceRoot":"","sources":["../../../../src/hooks/useTemplate.tsx"],"names":[],"mappings":";;;;;;AAAA,0FAA2D;AAC3D,mCAA2C;AAC3C,iCAA6C;AAC7C,yCAAsC;AAEtC,MAAM,iBAAiB,GAAG,gBAAO,CAAC,CAAC,WAAkB,EAAE,EAAE,CAAC,2BAAU,CAAC,OAAO,CAAC,WAAW,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC,CAAA;AAErG,MAAM,WAAW,GAAG,CAAC,cAAuB,EAAC,EAAE;IAElD,MAAM,KAAK,GAAG,mBAAQ,EAAE,CAAC;IACzB,MAAM,aAAa,GAAG,mBAAW,CAAC,CAAC,WAAmB,EAAC,EAAE;QACrD,IAAG,iBAAQ,CAAC,WAAW,CAAC,EAAE;YACtB,IAAG;gBACC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;gBAChD,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAC,0BAA0B,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,EAAC,CAAC,CAAC;aACnG;YAAC,OAAM,CAAC,EAAC,GAAE;SACf;QACD,OAAO,WAAW,CAAC;IACvB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEX,MAAM,UAAU,GAAG,eAAO,CAAC,GAAE,EAAE;QAC3B,IAAG,cAAc;YAAE,OAAO,aAAa,CAAC,cAAc,CAAC,CAAC;QACxD,OAAO,cAAc,CAAC;IAC1B,CAAC,EAAE,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;IAEpC,IAAG,cAAc,KAAK,SAAS;QAAE,OAAO,aAAa,CAAC;IAEtD,OAAO,UAAU,CAAC;AACtB,CAAC,CAAC;AArBW,QAAA,WAAW,eAqBtB;AAEF,kBAAe,mBAAW,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTemplate.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTemplate.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"useTemplate.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTemplate.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,oBAAqB,MAAM,QAqBlD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
@@ -1,13 +1,8 @@
|
|
1
|
-
import { useMemo, useCallback } from 'react';
|
2
|
-
import { useScope } from "./useScope";
|
3
|
-
import { isString, memoize, size } from 'lodash';
|
4
|
-
import { v5 as uuidv5 } from 'uuid';
|
5
1
|
import Handlebars from 'handlebars/dist/handlebars.min.js';
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
});
|
2
|
+
import { isString, memoize } from 'lodash';
|
3
|
+
import { useCallback, useMemo } from 'react';
|
4
|
+
import { useScope } from "./useScope";
|
5
|
+
const handlebarsCompile = memoize((stringValue) => Handlebars.compile(stringValue, { noEscape: true }));
|
11
6
|
export const useTemplate = (templateString) => {
|
12
7
|
const scope = useScope();
|
13
8
|
const applyTemplate = useCallback((stringValue) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTemplate.js","sourceRoot":"","sources":["../../../../src/hooks/useTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"useTemplate.js","sourceRoot":"","sources":["../../../../src/hooks/useTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAA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"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"useTemplate.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTemplate.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,oBAAqB,MAAM,QAqBlD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|