voodoojs 0.10.0 → 0.10.1

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Voodoo.js v0.10.0
2
+ * Voodoo.js v0.10.1
3
3
  * JavaScript feels like magic.
4
4
  * (c) 2026 Voodoo.js contributors. MIT License.
5
5
  */
@@ -2971,13 +2971,28 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
2971
2971
  var componentAliases = /* @__PURE__ */ new Map();
2972
2972
  var started = false;
2973
2973
  var observer = null;
2974
+ var startHooks = [];
2975
+ function onStart(hook) {
2976
+ startHooks.push(hook);
2977
+ }
2978
+ function runPhase(target, after) {
2979
+ for (const hook of startHooks) {
2980
+ try {
2981
+ hook(target, after);
2982
+ } catch (error) {
2983
+ console.error("[Voodoo] a start hook failed", error);
2984
+ }
2985
+ }
2986
+ }
2974
2987
  function start(root) {
2975
2988
  var _a2;
2976
2989
  if (typeof document === "undefined") return;
2977
2990
  const target = (_a2 = root != null ? root : config.root) != null ? _a2 : document.body;
2978
2991
  if (!target) return;
2979
2992
  Object.assign(allowedGlobals, config.globals);
2993
+ runPhase(target, false);
2980
2994
  walk(target, rootScope);
2995
+ runPhase(target, true);
2981
2996
  if (!started) {
2982
2997
  started = true;
2983
2998
  if (config.autoDiscover) observeDOM(target);
@@ -6868,7 +6883,7 @@ Suggestion: attribute expressions accept a single value. If the logic spans more
6868
6883
  Object.defineProperties(rootScope.data, Object.getOwnPropertyDescriptors(values));
6869
6884
  return rootScope.data;
6870
6885
  }
6871
- var version2 = "0.10.0";
6886
+ var version2 = "0.10.1";
6872
6887
  var core = {
6873
6888
  // Utilities first: Voodoo's own names can override.
6874
6889
  ...utils_exports,
@@ -21015,6 +21030,10 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
21015
21030
  "NOSCRIPT"
21016
21031
  ]);
21017
21032
  magic("$__jsx", (scope) => scope);
21033
+ onStart((root, after) => {
21034
+ if (after) activateJsx();
21035
+ else extractJsx(root);
21036
+ });
21018
21037
  var TEMPLATE = /* @__PURE__ */ Symbol("voodoo.jsx.template");
21019
21038
  function isTemplate(value) {
21020
21039
  return typeof value === "object" && value !== null && TEMPLATE in value;
@@ -21712,9 +21731,7 @@ textarea.v-dialog-input{min-height:96px;resize:vertical}
21712
21731
  const boot = () => {
21713
21732
  theme.init();
21714
21733
  applySavedPalette();
21715
- if (typeof V2.extractJsx === "function") V2.extractJsx();
21716
21734
  V2.start();
21717
- if (typeof V2.activateJsx === "function") V2.activateJsx();
21718
21735
  if (typeof V2.enableXrayShortcut === "function") V2.enableXrayShortcut();
21719
21736
  if (config.devtools) mountDevtools(V2);
21720
21737
  };