@toddledev/ssr
Advanced tools
Comparing version 0.0.2-alpha.14 to 0.0.2-alpha.15
import type { Component, ComponentData, ElementNodeModel } from '@toddledev/core/dist/component/component.types'; | ||
import { ToddleEnv } from '@toddledev/core/dist/formula/formula'; | ||
import { FormulaContext, ToddleEnv } from '@toddledev/core/dist/formula/formula'; | ||
export declare const escapeAttrValue: (value: any) => string; | ||
@@ -8,3 +8,3 @@ /** | ||
export declare const toEncodedText: (str: string) => string; | ||
export declare function getNodeAttrs({ node, data, component, packageName, env, }: { | ||
export declare function getNodeAttrs({ node, data, component, packageName, env, toddle, }: { | ||
node: Pick<ElementNodeModel, 'attrs' | 'style-variables'>; | ||
@@ -15,2 +15,3 @@ data: ComponentData; | ||
env: ToddleEnv; | ||
toddle: FormulaContext['toddle']; | ||
}): string; |
@@ -37,3 +37,3 @@ "use strict"; | ||
exports.toEncodedText = toEncodedText; | ||
function getNodeAttrs({ node, data, component, packageName, env, }) { | ||
function getNodeAttrs({ node, data, component, packageName, env, toddle, }) { | ||
const { style, ...restAttrs } = node.attrs; | ||
@@ -46,2 +46,3 @@ const nodeAttrs = Object.entries(restAttrs).reduce((appliedAttributes, [name, attrValue]) => { | ||
env, | ||
toddle, | ||
}); | ||
@@ -58,2 +59,3 @@ if ((0, util_1.toBoolean)(value)) { | ||
env, | ||
toddle, | ||
})) + (unit ?? '')}`); | ||
@@ -69,2 +71,3 @@ // Handle the style-attribute independently to merge with style variables | ||
env, | ||
toddle, | ||
}), | ||
@@ -71,0 +74,0 @@ ] |
@@ -12,3 +12,3 @@ "use strict"; | ||
const attributes_1 = require("./attributes"); | ||
const renderComponent = async ({ apiCache, children, component, data, env, evaluateComponentApis, files, includedComponents, instance, packageName, projectId, req, updateApiCache, }) => { | ||
const renderComponent = async ({ apiCache, children, component, data, env, evaluateComponentApis, files, toddle, includedComponents, instance, packageName, projectId, req, updateApiCache, }) => { | ||
const renderNode = async ({ id, node, data, packageName, isComponentRootNode = false, }) => { | ||
@@ -23,2 +23,3 @@ if (!node) { | ||
env, | ||
toddle, | ||
}; | ||
@@ -76,2 +77,3 @@ if (node.repeat) { | ||
env, | ||
toddle, | ||
}); | ||
@@ -185,2 +187,3 @@ const classHash = (0, className_1.getClassName)([node.style, node.variants]); | ||
env, | ||
toddle, | ||
}, | ||
@@ -220,2 +223,3 @@ req, | ||
env, | ||
toddle, | ||
}), | ||
@@ -234,2 +238,3 @@ ])), | ||
env, | ||
toddle, | ||
}); | ||
@@ -239,2 +244,3 @@ }), | ||
env, | ||
toddle, | ||
}), | ||
@@ -310,15 +316,16 @@ ])), | ||
return renderComponent({ | ||
apiCache, | ||
children, | ||
component, | ||
data, | ||
children, | ||
packageName, | ||
instance, | ||
env, | ||
evaluateComponentApis, | ||
files, | ||
includedComponents, | ||
apiCache, | ||
updateApiCache, | ||
files, | ||
instance, | ||
packageName, | ||
projectId, | ||
evaluateComponentApis, | ||
req, | ||
toddle: formulaContext.toddle, | ||
updateApiCache, | ||
}); | ||
@@ -341,14 +348,15 @@ }; | ||
const html = await renderComponent({ | ||
apiCache, | ||
component, | ||
data: formulaContext.data, | ||
packageName: undefined, | ||
instance: {}, | ||
env, | ||
evaluateComponentApis, | ||
files, | ||
includedComponents, | ||
instance: {}, | ||
packageName: undefined, | ||
projectId, | ||
req, | ||
apiCache, | ||
toddle: formulaContext.toddle, | ||
updateApiCache, | ||
evaluateComponentApis, | ||
projectId, | ||
}); | ||
@@ -355,0 +363,0 @@ return { html, apiCache }; |
{ | ||
"name": "@toddledev/ssr", | ||
"version": "0.0.2-alpha.14", | ||
"version": "0.0.2-alpha.15", | ||
"license": "Apache-2.0", | ||
@@ -19,3 +19,3 @@ "homepage": "https://github.com/toddledev/toddle", | ||
"dependencies": { | ||
"@toddledev/core": "0.0.2-alpha.14", | ||
"@toddledev/core": "0.0.2-alpha.15", | ||
"cookie": "1.0.2", | ||
@@ -22,0 +22,0 @@ "xss": "1.0.15" |
@@ -6,3 +6,7 @@ import type { | ||
} from '@toddledev/core/dist/component/component.types' | ||
import { applyFormula, ToddleEnv } from '@toddledev/core/dist/formula/formula' | ||
import { | ||
applyFormula, | ||
FormulaContext, | ||
ToddleEnv, | ||
} from '@toddledev/core/dist/formula/formula' | ||
import { isDefined, toBoolean } from '@toddledev/core/dist/utils/util' | ||
@@ -50,2 +54,3 @@ | ||
env, | ||
toddle, | ||
}: { | ||
@@ -57,2 +62,3 @@ node: Pick<ElementNodeModel, 'attrs' | 'style-variables'> | ||
env: ToddleEnv | ||
toddle: FormulaContext['toddle'] | ||
}) { | ||
@@ -67,2 +73,3 @@ const { style, ...restAttrs } = node.attrs | ||
env, | ||
toddle, | ||
}) | ||
@@ -85,2 +92,3 @@ if (toBoolean(value)) { | ||
env, | ||
toddle, | ||
}), | ||
@@ -100,2 +108,3 @@ ) + (unit ?? '') | ||
env, | ||
toddle, | ||
}), | ||
@@ -102,0 +111,0 @@ ] |
@@ -33,2 +33,3 @@ import { ApiStatus, LegacyApiStatus } from '@toddledev/core/dist/api/apiTypes' | ||
files, | ||
toddle, | ||
includedComponents, | ||
@@ -48,2 +49,3 @@ instance, | ||
files: ProjectFiles | ||
toddle: FormulaContext['toddle'] | ||
includedComponents: Component[] | ||
@@ -77,2 +79,3 @@ instance: Record<string, string> | ||
env, | ||
toddle, | ||
} | ||
@@ -144,2 +147,3 @@ if (node.repeat) { | ||
env, | ||
toddle, | ||
}) | ||
@@ -284,2 +288,3 @@ const classHash = getClassName([node.style, node.variants]) | ||
env, | ||
toddle, | ||
}, | ||
@@ -326,2 +331,3 @@ req, | ||
env, | ||
toddle, | ||
}), | ||
@@ -343,2 +349,3 @@ ]), | ||
env, | ||
toddle, | ||
}) | ||
@@ -349,2 +356,3 @@ }, | ||
env, | ||
toddle, | ||
}), | ||
@@ -471,15 +479,16 @@ ]), | ||
return renderComponent({ | ||
apiCache, | ||
children, | ||
component, | ||
data, | ||
children, | ||
packageName, | ||
instance, | ||
env, | ||
evaluateComponentApis, | ||
files, | ||
includedComponents, | ||
apiCache, | ||
updateApiCache, | ||
files, | ||
instance, | ||
packageName, | ||
projectId, | ||
evaluateComponentApis, | ||
req, | ||
toddle: formulaContext.toddle, | ||
updateApiCache, | ||
}) | ||
@@ -523,16 +532,17 @@ } | ||
const html = await renderComponent({ | ||
apiCache, | ||
component, | ||
data: formulaContext.data, | ||
packageName: undefined, | ||
instance: {}, | ||
env, | ||
evaluateComponentApis, | ||
files, | ||
includedComponents, | ||
instance: {}, | ||
packageName: undefined, | ||
projectId, | ||
req, | ||
apiCache, | ||
toddle: formulaContext.toddle, | ||
updateApiCache, | ||
evaluateComponentApis, | ||
projectId, | ||
}) | ||
return { html, apiCache } | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
99572
2131
+ Added@toddledev/core@0.0.2-alpha.15(transitive)
- Removed@toddledev/core@0.0.2-alpha.14(transitive)