@novely/core 0.40.1 → 0.40.2
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/index.d.ts +6 -0
- package/dist/index.global.js +9 -3
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -587,6 +587,12 @@ type CustomHandlerFunctionParameters<L extends string, S extends State> = {
|
|
|
587
587
|
* ```
|
|
588
588
|
*/
|
|
589
589
|
getDomNodes: CustomHandlerFunctionGetFn;
|
|
590
|
+
/**
|
|
591
|
+
* Function to get current Path. Path can be mutated. Can be helpful when making complex custom actions.
|
|
592
|
+
*
|
|
593
|
+
* Only use it when you know what you do
|
|
594
|
+
*/
|
|
595
|
+
getPath: () => Path;
|
|
590
596
|
/**
|
|
591
597
|
* Renderer Context
|
|
592
598
|
*/
|
package/dist/index.global.js
CHANGED
|
@@ -1009,7 +1009,7 @@ var Novely = (() => {
|
|
|
1009
1009
|
CUSTOM_ACTION_MAP.set(ctx.id + fn.key, holder);
|
|
1010
1010
|
return holder;
|
|
1011
1011
|
};
|
|
1012
|
-
var handleCustomAction = (ctx, fn, { lang, state, setMountElement, setClear, remove: renderersRemove }) => {
|
|
1012
|
+
var handleCustomAction = (ctx, fn, { lang, state, setMountElement, setClear, remove: renderersRemove, getStack: getStack2 }) => {
|
|
1013
1013
|
const holder = getCustomActionHolder(ctx, fn);
|
|
1014
1014
|
const flags = {
|
|
1015
1015
|
...ctx.meta
|
|
@@ -1047,6 +1047,10 @@ var Novely = (() => {
|
|
|
1047
1047
|
holder.cleanup();
|
|
1048
1048
|
renderersRemove();
|
|
1049
1049
|
};
|
|
1050
|
+
const stack = getStack2(ctx);
|
|
1051
|
+
const getPath = () => {
|
|
1052
|
+
return stack.value[0];
|
|
1053
|
+
};
|
|
1050
1054
|
return fn({
|
|
1051
1055
|
flags,
|
|
1052
1056
|
lang,
|
|
@@ -1055,7 +1059,8 @@ var Novely = (() => {
|
|
|
1055
1059
|
clear,
|
|
1056
1060
|
remove,
|
|
1057
1061
|
rendererContext: ctx,
|
|
1058
|
-
getDomNodes
|
|
1062
|
+
getDomNodes,
|
|
1063
|
+
getPath
|
|
1059
1064
|
});
|
|
1060
1065
|
};
|
|
1061
1066
|
|
|
@@ -2024,7 +2029,8 @@ var Novely = (() => {
|
|
|
2024
2029
|
const result = handleCustomAction(ctx, fn, {
|
|
2025
2030
|
...ctx.custom(fn),
|
|
2026
2031
|
state,
|
|
2027
|
-
lang
|
|
2032
|
+
lang,
|
|
2033
|
+
getStack: useStack
|
|
2028
2034
|
});
|
|
2029
2035
|
const next2 = () => {
|
|
2030
2036
|
if (fn.requireUserAction && !ctx.meta.preview) {
|