praxis-kit 3.0.0 → 3.1.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.
- package/dist/{chunk-PBBPAHMV.js → chunk-6RJN5B6L.js} +25 -14
- package/dist/codemod/index.d.ts +1 -20
- package/dist/codemod/index.js +668 -637
- package/dist/contract/index.d.ts +5 -5
- package/dist/contract/index.js +23 -12
- package/dist/eslint/index.js +16 -16
- package/dist/lit/index.d.ts +10 -9
- package/dist/lit/index.js +34 -13
- package/dist/{merge-refs-CfAbwCKz.d.ts → merge-refs-BKyE8h8M.d.ts} +8 -7
- package/dist/preact/index.d.ts +8 -7
- package/dist/preact/index.js +24 -13
- package/dist/react/index.d.ts +7 -7
- package/dist/react/index.js +1 -1
- package/dist/react/legacy.d.ts +7 -7
- package/dist/react/legacy.js +1 -1
- package/dist/solid/index.d.ts +8 -7
- package/dist/solid/index.js +24 -13
- package/dist/svelte/index.d.ts +10 -8
- package/dist/svelte/index.js +23 -12
- package/dist/vue/index.d.ts +8 -7
- package/dist/vue/index.js +24 -13
- package/dist/web/index.d.ts +10 -9
- package/dist/web/index.js +25 -13
- package/package.json +4 -4
|
@@ -585,7 +585,7 @@ function isKnownAriaRole(value) {
|
|
|
585
585
|
return isString(value) && KNOWN_ARIA_ROLES_SET.has(value);
|
|
586
586
|
}
|
|
587
587
|
|
|
588
|
-
// ../core/dist/chunk-
|
|
588
|
+
// ../core/dist/chunk-2NJ5XLOA.js
|
|
589
589
|
var IMPLICIT_ROLE_RECORD2 = {
|
|
590
590
|
article: "article",
|
|
591
591
|
aside: "complementary",
|
|
@@ -614,26 +614,37 @@ function getImplicitRole(tag) {
|
|
|
614
614
|
if (tag in IMPLICIT_ROLE_RECORD2) return IMPLICIT_ROLE_RECORD2[tag];
|
|
615
615
|
return void 0;
|
|
616
616
|
}
|
|
617
|
-
var COMPONENT_DEFAULT_TAG = /* @__PURE__ */ Symbol("praxis.component-default-tag");
|
|
618
|
-
function
|
|
617
|
+
var COMPONENT_DEFAULT_TAG = /* @__PURE__ */ Symbol.for("praxis.component-default-tag");
|
|
618
|
+
function getAsProp(child) {
|
|
619
|
+
if (!isObject(child) || !("props" in child)) return void 0;
|
|
620
|
+
const props = child.props;
|
|
621
|
+
if (!isObject(props)) return void 0;
|
|
622
|
+
const as = props.as;
|
|
623
|
+
return isString(as) && as !== "" ? as : void 0;
|
|
624
|
+
}
|
|
625
|
+
function getTag(child) {
|
|
619
626
|
if (!isObject(child) || !("type" in child)) return void 0;
|
|
620
627
|
const t = child.type;
|
|
621
628
|
if (isString(t)) return t;
|
|
622
|
-
if (
|
|
629
|
+
if (typeof t === "function" || isObject(t)) {
|
|
623
630
|
const defaultTag = t[COMPONENT_DEFAULT_TAG];
|
|
624
631
|
if (!isString(defaultTag)) return void 0;
|
|
625
|
-
|
|
626
|
-
const as = isObject(props) && "as" in props ? props.as : void 0;
|
|
627
|
-
return isString(as) ? as : defaultTag;
|
|
632
|
+
return getAsProp(child) ?? defaultTag;
|
|
628
633
|
}
|
|
629
634
|
return void 0;
|
|
630
635
|
}
|
|
631
|
-
function isTag(...
|
|
636
|
+
function isTag(...args) {
|
|
637
|
+
if (isString(args[0])) {
|
|
638
|
+
const set2 = new Set(args);
|
|
639
|
+
return (child2) => {
|
|
640
|
+
const tag2 = getTag(child2);
|
|
641
|
+
return tag2 !== void 0 && set2.has(tag2);
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
const [child, ...tags] = args;
|
|
632
645
|
const set = new Set(tags);
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
return tag !== void 0 && set.has(tag);
|
|
636
|
-
};
|
|
646
|
+
const tag = getTag(child);
|
|
647
|
+
return tag !== void 0 && set.has(tag);
|
|
637
648
|
}
|
|
638
649
|
var pendingAsyncWarns2 = /* @__PURE__ */ new Set();
|
|
639
650
|
var asyncWarnScheduled2 = false;
|
|
@@ -2036,8 +2047,8 @@ function buildRuntime(options, defaultSlot, normalizeChildren) {
|
|
|
2036
2047
|
}
|
|
2037
2048
|
|
|
2038
2049
|
// ../shared/src/guards/children/component-id.ts
|
|
2039
|
-
var COMPONENT_ID2 = /* @__PURE__ */ Symbol("praxis.component-id");
|
|
2040
|
-
var COMPONENT_DEFAULT_TAG2 = /* @__PURE__ */ Symbol("praxis.component-default-tag");
|
|
2050
|
+
var COMPONENT_ID2 = /* @__PURE__ */ Symbol.for("praxis.component-id");
|
|
2051
|
+
var COMPONENT_DEFAULT_TAG2 = /* @__PURE__ */ Symbol.for("praxis.component-default-tag");
|
|
2041
2052
|
|
|
2042
2053
|
// ../../adapters/react/src/shared/apply-display-name.ts
|
|
2043
2054
|
function applyDisplayName(component, name) {
|
package/dist/codemod/index.d.ts
CHANGED
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
import { Project } from 'ts-morph';
|
|
2
1
|
|
|
3
|
-
|
|
4
|
-
declare function migratePathsInProject(project: Project, options: {
|
|
5
|
-
isDryRun: boolean;
|
|
6
|
-
isVerbose: boolean;
|
|
7
|
-
}): {
|
|
8
|
-
totalRewrites: number;
|
|
9
|
-
filesModified: number;
|
|
10
|
-
};
|
|
11
|
-
declare function renameInProject(project: Project, options: {
|
|
12
|
-
fromName: string;
|
|
13
|
-
toName: string;
|
|
14
|
-
isDryRun: boolean;
|
|
15
|
-
isVerbose: boolean;
|
|
16
|
-
}): {
|
|
17
|
-
totalRenames: number;
|
|
18
|
-
filesModified: number;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { migratePathsInProject, renameInProject, resolveReplacement };
|
|
2
|
+
export { }
|