@knapsack/renderer-twig 4.67.0--canary.4437.fa825f8.1 → 4.67.0--canary.4435.a81ff14.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderer-twig.d.ts","sourceRoot":"","sources":["../src/renderer-twig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAO,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACxB,+BAA+B,EAChC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,YAAY,EAAE,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;
|
1
|
+
{"version":3,"file":"renderer-twig.d.ts","sourceRoot":"","sources":["../src/renderer-twig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAO,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACxB,+BAA+B,EAChC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,YAAY,EAAE,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAqB9E,qBAAa,oBACX,SAAQ,oBACR,YAAW,wBAAwB;;IAEnC,YAAY,EAAE,YAAY,CAAC;gBAGf,MAAM,EAAE,kBAAkB;IAwBhC,MAAM,CACV,GAAG,EAAE,oBAAoB,GACxB,OAAO,CAAC,+BAA+B,CAAC;IAOrC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC;IA2HpD,sBAAsB,IAAI,UAAU,CACxC,wBAAwB,CAAC,wBAAwB,CAAC,CACnD;IAsCD,OAAO,EAAE,wBAAwB,CAAC,SAAS,CAAC,CA4BzC;CACJ"}
|
package/dist/renderer-twig.js
CHANGED
@@ -25,6 +25,8 @@ const file_utils_1 = require("@knapsack/file-utils");
|
|
25
25
|
const utils_1 = require("./utils");
|
26
26
|
const pkg = JSON.parse((0, fs_extra_1.readFileSync)((0, path_1.join)(__dirname, '../package.json'), 'utf-8'));
|
27
27
|
app_1.log.setupUpdateNotifier(pkg);
|
28
|
+
// static methods only
|
29
|
+
const { createSlotOptionsHtmlTags } = app_1.KnapsackRendererBase;
|
28
30
|
const protoTemplatePath = (0, path_1.join)(__dirname, '../prototype-template/prototype-template.twig');
|
29
31
|
(0, file_utils_1.assertFileExists)(protoTemplatePath);
|
30
32
|
const protoTwigNamespace = 'knapsack-renderer-twig-prototype-template';
|
@@ -45,6 +47,7 @@ class KnapsackTwigRenderer extends app_1.KnapsackRendererBase {
|
|
45
47
|
enableDataDemos: true,
|
46
48
|
enableTemplateDemos: true,
|
47
49
|
hasSlotsSupport: true,
|
50
|
+
hasSlotOptionsSupport: true,
|
48
51
|
version: pkg.version,
|
49
52
|
hasInferSpecSupport: false,
|
50
53
|
hasTemplateSuggestionsSupport: true,
|
@@ -105,7 +108,7 @@ class KnapsackTwigRenderer extends app_1.KnapsackRendererBase {
|
|
105
108
|
return (0, fs_extra_1.readFile)(templateDemoPath, 'utf8');
|
106
109
|
}
|
107
110
|
case 'data': {
|
108
|
-
const { data: { props, slots }, } = demo;
|
111
|
+
const { data: { props, slots, slotsOptionsComputed }, } = demo;
|
109
112
|
if (!slots) {
|
110
113
|
return (0, utils_1.getTwigUsage)({
|
111
114
|
templateName: template.alias,
|
@@ -151,9 +154,15 @@ class KnapsackTwigRenderer extends app_1.KnapsackRendererBase {
|
|
151
154
|
value: slotName,
|
152
155
|
});
|
153
156
|
const slotCodes = slotProps[slotName];
|
157
|
+
const slotOptionsComputed = slotsOptionsComputed === null || slotsOptionsComputed === void 0 ? void 0 : slotsOptionsComputed[slotName];
|
158
|
+
const { openTag, closeTag } = createSlotOptionsHtmlTags({
|
159
|
+
slotOptionsComputed,
|
160
|
+
classAttributeName: 'class',
|
161
|
+
stylesValueType: 'string',
|
162
|
+
});
|
154
163
|
return `
|
155
164
|
{% set ${slotName} %}
|
156
|
-
${slotCodes.join('\n
|
165
|
+
${[openTag, ...slotCodes, closeTag].filter(Boolean).join('\n')}
|
157
166
|
{% endset %}
|
158
167
|
`.trim();
|
159
168
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderer-twig.js","sourceRoot":"","sources":["../src/renderer-twig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA0D;AAM1D,2CAAuE;AACvE,0EAA8E;AAC9E,+BAAqE;AACrE,uCAAkD;AAClD,qDAAwD;AACxD,mCAAuC;AAEvC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,IAAA,uBAAY,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAC1D,CAAC;AACF,SAAG,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;AAE7B,MAAM,iBAAiB,GAAG,IAAA,WAAI,EAC5B,SAAS,EACT,+CAA+C,CAChD,CAAC;AACF,IAAA,6BAAgB,EAAC,iBAAiB,CAAC,CAAC;AACpC,MAAM,kBAAkB,GAAG,2CAA2C,CAAC;AAEvE,MAAa,oBACX,SAAQ,0BAAoB;IAM5B,YAAY,MAA0B;QACpC,KAAK,CAAC;YACJ,EAAE,EAAE,mBAAW,CAAC,IAAI;YACpB,QAAQ,EAAE,MAAM;YAChB,SAAS,EAAE,OAAO;SACnB,CAAC,CAAC;QAPL,4CAAgC;
|
1
|
+
{"version":3,"file":"renderer-twig.js","sourceRoot":"","sources":["../src/renderer-twig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA0D;AAM1D,2CAAuE;AACvE,0EAA8E;AAC9E,+BAAqE;AACrE,uCAAkD;AAClD,qDAAwD;AACxD,mCAAuC;AAEvC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,IAAA,uBAAY,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAC1D,CAAC;AACF,SAAG,CAAC,mBAAmB,CAAC,GAA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AE,CAAC;QAEX,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAsB,EAAE;YACnE,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAC9C,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAChD,CAAC;YACF,IAAI,KAAa,CAAC;YAClB,IAAI,SAAS,EAAE,CAAC;gBACd,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;oBAC/B,IAAI,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;wBAC9B,MAAM,OAAO,GAAG,IAAA,eAAQ,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;wBACzC,KAAK,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,OAAO,EAAE,CAAC;oBACxC,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,QAAQ;gBACd,KAAK;aACN,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,WAAW,EAAE,CAAC;IACzB,CAAC;CA+BF;AAxOD,oDAwOC"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@knapsack/renderer-twig",
|
3
3
|
"description": "Render Twig",
|
4
|
-
"version": "4.67.0--canary.
|
4
|
+
"version": "4.67.0--canary.4435.a81ff14.0",
|
5
5
|
"main": "index.js",
|
6
6
|
"types": "index.d.ts",
|
7
7
|
"exports": {
|
@@ -25,16 +25,16 @@
|
|
25
25
|
"author": "Knapsack (https://www.knapsack.cloud)",
|
26
26
|
"dependencies": {
|
27
27
|
"@basalt/twig-renderer": "^3.2.2",
|
28
|
-
"@knapsack/app": "4.67.0--canary.
|
29
|
-
"@knapsack/file-utils": "4.67.0--canary.
|
30
|
-
"@knapsack/types": "4.67.0--canary.
|
28
|
+
"@knapsack/app": "4.67.0--canary.4435.a81ff14.0",
|
29
|
+
"@knapsack/file-utils": "4.67.0--canary.4435.a81ff14.0",
|
30
|
+
"@knapsack/types": "4.67.0--canary.4435.a81ff14.0",
|
31
31
|
"ejs": "^3.1.10",
|
32
32
|
"fs-extra": "^11.2.0"
|
33
33
|
},
|
34
34
|
"devDependencies": {
|
35
|
-
"@knapsack/eslint-config-starter": "4.67.0--canary.
|
36
|
-
"@knapsack/test-ava": "4.67.0--canary.
|
37
|
-
"@knapsack/typescript-config-starter": "4.67.0--canary.
|
35
|
+
"@knapsack/eslint-config-starter": "4.67.0--canary.4435.a81ff14.0",
|
36
|
+
"@knapsack/test-ava": "4.67.0--canary.4435.a81ff14.0",
|
37
|
+
"@knapsack/typescript-config-starter": "4.67.0--canary.4435.a81ff14.0",
|
38
38
|
"@types/fs-extra": "^11.0.4",
|
39
39
|
"ava": "^6.1.3",
|
40
40
|
"eslint": "^8.57.0",
|
@@ -48,5 +48,5 @@
|
|
48
48
|
"directory": "apps/client/renderers/renderer-twig",
|
49
49
|
"type": "git"
|
50
50
|
},
|
51
|
-
"gitHead": "
|
51
|
+
"gitHead": "a81ff1404f2d1a9a3fec741f0df7872d7660ad2c"
|
52
52
|
}
|