@tooark/react 1.7.0 → 1.8.0
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/README.md +2 -2
- package/README.pt-BR.md +2 -2
- package/dist/ark-alert.d.ts +1 -1
- package/dist/ark-alert.js +2 -1
- package/dist/ark-avatar.d.ts +1 -1
- package/dist/ark-avatar.js +2 -1
- package/dist/ark-badge.d.ts +1 -1
- package/dist/ark-badge.js +2 -1
- package/dist/ark-button.d.ts +6 -2
- package/dist/ark-button.js +2 -1
- package/dist/ark-calendar.d.ts +1 -1
- package/dist/ark-calendar.js +2 -1
- package/dist/ark-card.d.ts +1 -1
- package/dist/ark-card.js +2 -1
- package/dist/ark-carousel.d.ts +1 -1
- package/dist/ark-carousel.js +2 -1
- package/dist/ark-checkbox.d.ts +1 -1
- package/dist/ark-checkbox.js +2 -1
- package/dist/ark-clock.d.ts +1 -1
- package/dist/ark-clock.js +2 -1
- package/dist/ark-color-swatches.d.ts +1 -1
- package/dist/ark-color-swatches.js +2 -1
- package/dist/ark-command-palette.d.ts +3 -3
- package/dist/ark-command-palette.js +3 -2
- package/dist/ark-copy-button.d.ts +1 -1
- package/dist/ark-copy-button.js +2 -1
- package/dist/ark-data-view.d.ts +1 -1
- package/dist/ark-data-view.js +2 -1
- package/dist/ark-datepicker.d.ts +1 -1
- package/dist/ark-datepicker.js +2 -1
- package/dist/ark-dialog.d.ts +1 -1
- package/dist/ark-dialog.js +2 -1
- package/dist/ark-drawer.d.ts +1 -1
- package/dist/ark-drawer.js +2 -1
- package/dist/ark-empty.d.ts +1 -1
- package/dist/ark-empty.js +2 -1
- package/dist/ark-file-input.d.ts +2 -2
- package/dist/ark-file-input.js +2 -1
- package/dist/ark-input.d.ts +6 -2
- package/dist/ark-input.js +2 -1
- package/dist/ark-kbd.d.ts +1 -1
- package/dist/ark-kbd.js +2 -1
- package/dist/ark-kv-editor.d.ts +1 -1
- package/dist/ark-kv-editor.js +2 -1
- package/dist/ark-mark.d.ts +1 -1
- package/dist/ark-mark.js +2 -1
- package/dist/ark-menu.d.ts +1 -1
- package/dist/ark-menu.js +4 -3
- package/dist/ark-nav.d.ts +1 -1
- package/dist/ark-nav.js +4 -3
- package/dist/ark-pagination.d.ts +2 -2
- package/dist/ark-pagination.js +2 -1
- package/dist/ark-progress.d.ts +1 -1
- package/dist/ark-progress.js +2 -1
- package/dist/ark-radio.d.ts +1 -1
- package/dist/ark-radio.js +2 -1
- package/dist/ark-scheduler.d.ts +1 -1
- package/dist/ark-scheduler.js +2 -1
- package/dist/ark-select.d.ts +1 -1
- package/dist/ark-select.js +2 -1
- package/dist/ark-shape-picker.d.ts +1 -1
- package/dist/ark-shape-picker.js +2 -1
- package/dist/ark-skeleton.d.ts +1 -1
- package/dist/ark-skeleton.js +2 -1
- package/dist/ark-spinner.d.ts +1 -1
- package/dist/ark-spinner.js +2 -1
- package/dist/ark-split-pane.d.ts +1 -1
- package/dist/ark-split-pane.js +2 -1
- package/dist/ark-status-dot.d.ts +1 -1
- package/dist/ark-status-dot.js +2 -1
- package/dist/ark-switch.d.ts +1 -1
- package/dist/ark-switch.js +2 -1
- package/dist/ark-tabs.d.ts +1 -1
- package/dist/ark-tabs.js +3 -2
- package/dist/ark-textarea.d.ts +1 -1
- package/dist/ark-textarea.js +2 -1
- package/dist/ark-time.d.ts +1 -1
- package/dist/ark-time.js +2 -1
- package/dist/ark-toaster.d.ts +1 -1
- package/dist/ark-toaster.js +2 -1
- package/dist/ark-toggle.d.ts +1 -1
- package/dist/ark-toggle.js +3 -2
- package/dist/ark-tooltip.d.ts +1 -1
- package/dist/ark-tooltip.js +2 -1
- package/dist/ark-tree.d.ts +2 -2
- package/dist/ark-tree.js +5 -3
- package/dist/chart.d.ts +1 -1
- package/dist/chart.js +2 -1
- package/dist/code.d.ts +1 -1
- package/dist/code.js +2 -1
- package/dist/dom-props.d.ts +6 -0
- package/dist/dom-props.js +13 -1
- package/dist/jsx-intrinsics.d.ts +7 -0
- package/dist/wysiwyg.d.ts +2 -2
- package/dist/wysiwyg.js +3 -2
- package/package.json +6 -6
package/dist/ark-tree.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { createElement, forwardRef, useEffect } from "react";
|
|
2
|
+
import { domAttrs } from "./dom-props.js";
|
|
2
3
|
import { ensureTooarkComponentsRegistered } from "./register.js";
|
|
3
4
|
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
4
5
|
import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
|
|
5
6
|
export const ArkTree = forwardRef(function ArkTree(props, forwardedRef) {
|
|
6
|
-
const { children, className, checkboxes, propagate, value, onToggle, onSelectionChange, onActivate, ...rest } = props;
|
|
7
|
+
const { children, className, checkboxes, propagate, value, iconColor, onToggle, onSelectionChange, onActivate, ...rest } = props;
|
|
7
8
|
const [ref, setRef] = useForwardedRef(forwardedRef);
|
|
8
9
|
useEffect(() => {
|
|
9
10
|
ensureTooarkComponentsRegistered();
|
|
@@ -25,11 +26,12 @@ export const ArkTree = forwardRef(function ArkTree(props, forwardedRef) {
|
|
|
25
26
|
};
|
|
26
27
|
}, [ref, onToggle, onSelectionChange, onActivate]);
|
|
27
28
|
const attrs = {
|
|
28
|
-
...rest,
|
|
29
|
+
...domAttrs(rest),
|
|
29
30
|
ref: setRef,
|
|
30
31
|
class: className,
|
|
31
32
|
checkboxes: checkboxes ? "" : undefined,
|
|
32
33
|
propagate: propagate ? "" : undefined,
|
|
34
|
+
"icon-color": iconColor || undefined,
|
|
33
35
|
value: Array.isArray(value) ? (value.length ? JSON.stringify(value) : undefined) : value || undefined
|
|
34
36
|
};
|
|
35
37
|
return createElement("ark-tree", attrs, children);
|
|
@@ -40,7 +42,7 @@ export const ArkTreeItem = forwardRef(function ArkTreeItem(props, forwardedRef)
|
|
|
40
42
|
ensureTooarkComponentsRegistered();
|
|
41
43
|
}, []);
|
|
42
44
|
const attrs = {
|
|
43
|
-
...rest,
|
|
45
|
+
...domAttrs(rest),
|
|
44
46
|
ref: forwardedRef,
|
|
45
47
|
class: className,
|
|
46
48
|
expanded: expanded ? "" : undefined,
|
package/dist/chart.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ArkChart as ArkChartElement, type EChartsOption } from "@tooark/chart";
|
|
2
2
|
import type React from "react";
|
|
3
|
-
import type
|
|
3
|
+
import { type ArkDomProps } from "./dom-props.js";
|
|
4
4
|
/** Atributos da tag `ark-chart`, os mesmos da entrada principal, mais as propriedades JS. */
|
|
5
5
|
type ArkChartTagProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
|
|
6
6
|
testid?: string;
|
package/dist/chart.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// @tooark/chart) só entre no app que importa este caminho. Também tipa a tag crua <ark-chart> com as propriedades JS.
|
|
3
3
|
import { registerTooarkChart } from "@tooark/chart";
|
|
4
4
|
import { createElement, forwardRef, useEffect } from "react";
|
|
5
|
+
import { domAttrs } from "./dom-props.js";
|
|
5
6
|
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
6
7
|
import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
|
|
7
8
|
export const ArkChart = forwardRef(function ArkChart(props, forwardedRef) {
|
|
@@ -26,7 +27,7 @@ export const ArkChart = forwardRef(function ArkChart(props, forwardedRef) {
|
|
|
26
27
|
return () => el.removeEventListener("ark-chart-click", handle);
|
|
27
28
|
}, [ref, onChartClick]);
|
|
28
29
|
const attrs = {
|
|
29
|
-
...rest,
|
|
30
|
+
...domAttrs(rest),
|
|
30
31
|
ref: setRef,
|
|
31
32
|
class: className,
|
|
32
33
|
"auto-resize": autoResize === false ? "false" : undefined
|
package/dist/code.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ArkCodeCompletion, type ArkCodeCompletionSource, type ArkCodeEditor as ArkCodeEditorElement, type ArkCodeExtension, type ArkCodeFormatter, type ArkCodeIndentStyle, type ArkCodeLanguage, type ArkCodeLineEnding, type ArkCodeVariable } from "@tooark/code";
|
|
2
2
|
import type { ArkSize } from "@tooark/core";
|
|
3
3
|
import type React from "react";
|
|
4
|
-
import type
|
|
4
|
+
import { type ArkDomProps } from "./dom-props.js";
|
|
5
5
|
/** Atributos da tag `ark-code-editor`, os mesmos da entrada principal, mais as propriedades JS. */
|
|
6
6
|
type ArkCodeEditorTagProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
|
|
7
7
|
testid?: string;
|
package/dist/code.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// propriedades JS.
|
|
4
4
|
import { registerTooarkCode } from "@tooark/code";
|
|
5
5
|
import { createElement, forwardRef, useEffect } from "react";
|
|
6
|
+
import { domAttrs } from "./dom-props.js";
|
|
6
7
|
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
7
8
|
import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
|
|
8
9
|
/** Propriedades JS do editor, atribuídas pela ref e só quando a referência muda. */
|
|
@@ -56,7 +57,7 @@ export const ArkCodeEditor = forwardRef(function ArkCodeEditor(props, forwardedR
|
|
|
56
57
|
}, [ref, onChange, onSubmit, onFormatError]);
|
|
57
58
|
const off = (on) => (on === false ? "false" : undefined);
|
|
58
59
|
const attrs = {
|
|
59
|
-
...rest,
|
|
60
|
+
...domAttrs(rest),
|
|
60
61
|
ref: setRef,
|
|
61
62
|
class: className,
|
|
62
63
|
readonly: readonly ? "" : undefined,
|
package/dist/dom-props.d.ts
CHANGED
|
@@ -6,3 +6,9 @@ import type React from "react";
|
|
|
6
6
|
* de fora: só os wrappers de elementos com conteúdo o declaram.
|
|
7
7
|
*/
|
|
8
8
|
export type ArkDomProps<Props> = Props & Omit<React.HTMLAttributes<HTMLElement>, keyof Props | "children">;
|
|
9
|
+
/**
|
|
10
|
+
* O `rest` de um wrapper pronto para o elemento, com os `aria-*` booleanos convertidos em texto. Num custom element
|
|
11
|
+
* o React 19 grava `true` como atributo vazio (`aria-pressed=""`, valor inválido em ARIA), enquanto num elemento
|
|
12
|
+
* nativo grava `"true"`; os tipos do React aceitam o booleano nos dois, então o wrapper iguala o resultado.
|
|
13
|
+
*/
|
|
14
|
+
export declare function domAttrs(rest: object): Record<string, unknown>;
|
package/dist/dom-props.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* O `rest` de um wrapper pronto para o elemento, com os `aria-*` booleanos convertidos em texto. Num custom element
|
|
3
|
+
* o React 19 grava `true` como atributo vazio (`aria-pressed=""`, valor inválido em ARIA), enquanto num elemento
|
|
4
|
+
* nativo grava `"true"`; os tipos do React aceitam o booleano nos dois, então o wrapper iguala o resultado.
|
|
5
|
+
*/
|
|
6
|
+
export function domAttrs(rest) {
|
|
7
|
+
const attrs = { ...rest };
|
|
8
|
+
for (const name of Object.keys(attrs)) {
|
|
9
|
+
if (typeof attrs[name] === "boolean" && name.startsWith("aria-"))
|
|
10
|
+
attrs[name] = String(attrs[name]);
|
|
11
|
+
}
|
|
12
|
+
return attrs;
|
|
13
|
+
}
|
package/dist/jsx-intrinsics.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ import type {
|
|
|
34
34
|
ArkTimeFormat,
|
|
35
35
|
ArkToastPosition,
|
|
36
36
|
ArkTooltipSide,
|
|
37
|
+
ArkTreeIcons,
|
|
38
|
+
ArkTreeItemIcon,
|
|
37
39
|
ArkTreeSelection
|
|
38
40
|
} from "@tooark/core";
|
|
39
41
|
import React from "react";
|
|
@@ -73,6 +75,7 @@ interface ArkIntrinsicElements {
|
|
|
73
75
|
"ark-button": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
|
|
74
76
|
testid?: string;
|
|
75
77
|
type?: ArkButtonType;
|
|
78
|
+
form?: string;
|
|
76
79
|
disabled?: boolean;
|
|
77
80
|
variant?: ArkButtonVariant;
|
|
78
81
|
intent?: ArkIntent;
|
|
@@ -441,6 +444,8 @@ interface ArkIntrinsicElements {
|
|
|
441
444
|
propagate?: boolean;
|
|
442
445
|
value?: string;
|
|
443
446
|
label?: string;
|
|
447
|
+
icons?: ArkTreeIcons;
|
|
448
|
+
"icon-color"?: string;
|
|
444
449
|
size?: ArkSize;
|
|
445
450
|
theme?: ArkTheme;
|
|
446
451
|
};
|
|
@@ -448,6 +453,7 @@ interface ArkIntrinsicElements {
|
|
|
448
453
|
testid?: string;
|
|
449
454
|
value?: string;
|
|
450
455
|
label?: string;
|
|
456
|
+
icon?: ArkTreeItemIcon;
|
|
451
457
|
expanded?: boolean;
|
|
452
458
|
lazy?: boolean;
|
|
453
459
|
loading?: boolean;
|
|
@@ -582,6 +588,7 @@ interface ArkIntrinsicElements {
|
|
|
582
588
|
autocomplete?: string;
|
|
583
589
|
autofocus?: boolean;
|
|
584
590
|
inputmode?: string;
|
|
591
|
+
list?: string;
|
|
585
592
|
maxlength?: number | string;
|
|
586
593
|
minlength?: number | string;
|
|
587
594
|
pattern?: string;
|
package/dist/wysiwyg.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ArkLang } from "@tooark/core";
|
|
2
2
|
import { type ArkWysiwygContent, type ArkWysiwygEditor as ArkWysiwygEditorElement, type ArkWysiwygUploadError, type ArkWysiwygUploader, type ArkWysiwygViewer as ArkWysiwygViewerElement } from "@tooark/wysiwyg";
|
|
3
3
|
import type React from "react";
|
|
4
|
-
import type
|
|
4
|
+
import { type ArkDomProps } from "./dom-props.js";
|
|
5
5
|
/** Atributos da tag `ark-wysiwyg-editor`, os mesmos da entrada principal, mais as propriedades JS. */
|
|
6
6
|
type ArkWysiwygEditorTagProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
|
|
7
7
|
testid?: string;
|
|
@@ -90,7 +90,7 @@ export declare const ArkWysiwygEditor: React.ForwardRefExoticComponent<{
|
|
|
90
90
|
onChange?: (event: CustomEvent<ArkWysiwygContent>) => void;
|
|
91
91
|
/** Arquivo recusado ou upload que falhou, com o motivo em `detail`. */
|
|
92
92
|
onUploadError?: (event: CustomEvent<ArkWysiwygUploadError>) => void;
|
|
93
|
-
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "lang" | "content" | "onChange" | "testid" | "theme" | "localeJson" | "
|
|
93
|
+
} & Omit<React.HTMLAttributes<HTMLElement>, "children" | "className" | "lang" | "content" | "onChange" | "testid" | "theme" | "localeJson" | "colors" | "placeholder" | "toolbar" | "uploadFile" | "editable" | "highlights" | "maxFileSize" | "onUploadError"> & React.RefAttributes<ArkWysiwygEditorElement>>;
|
|
94
94
|
export type ArkWysiwygViewerProps = ArkDomProps<{
|
|
95
95
|
/** Conteúdo como JSON do Tiptap, sanitizado ao entrar. */
|
|
96
96
|
content?: ArkWysiwygContent | null;
|
package/dist/wysiwyg.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { registerTooarkWysiwyg } from "@tooark/wysiwyg";
|
|
2
2
|
import { createElement, forwardRef, useEffect, useRef } from "react";
|
|
3
|
+
import { domAttrs } from "./dom-props.js";
|
|
3
4
|
import { useForwardedRef } from "./use-forwarded-ref.js";
|
|
4
5
|
import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
|
|
5
6
|
export const ArkWysiwygEditor = forwardRef(function ArkWysiwygEditor(props, forwardedRef) {
|
|
@@ -42,7 +43,7 @@ export const ArkWysiwygEditor = forwardRef(function ArkWysiwygEditor(props, forw
|
|
|
42
43
|
};
|
|
43
44
|
}, [ref, onChange, onUploadError]);
|
|
44
45
|
const attrs = {
|
|
45
|
-
...rest,
|
|
46
|
+
...domAttrs(rest),
|
|
46
47
|
ref: setRef,
|
|
47
48
|
class: className,
|
|
48
49
|
editable: editable === false ? "false" : undefined,
|
|
@@ -64,5 +65,5 @@ export const ArkWysiwygViewer = forwardRef(function ArkWysiwygViewer(props, forw
|
|
|
64
65
|
if (el && content !== undefined && el.content !== content)
|
|
65
66
|
el.content = content;
|
|
66
67
|
}, [ref, content]);
|
|
67
|
-
return createElement("ark-wysiwyg-viewer", { ...rest, ref: setRef, class: className });
|
|
68
|
+
return createElement("ark-wysiwyg-viewer", { ...domAttrs(rest), ref: setRef, class: className });
|
|
68
69
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tooark/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Tooark React — typed wrappers for ark-* components for React 18 and 19",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tooark",
|
|
@@ -100,13 +100,13 @@
|
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@tooark/core": "^1.
|
|
104
|
-
"@tooark/web-components": "^1.
|
|
103
|
+
"@tooark/core": "^1.8.0",
|
|
104
|
+
"@tooark/web-components": "^1.8.0"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
|
-
"@tooark/chart": "^1.
|
|
108
|
-
"@tooark/code": "^1.
|
|
109
|
-
"@tooark/wysiwyg": "^1.
|
|
107
|
+
"@tooark/chart": "^1.8.0",
|
|
108
|
+
"@tooark/code": "^1.8.0",
|
|
109
|
+
"@tooark/wysiwyg": "^1.8.0"
|
|
110
110
|
},
|
|
111
111
|
"scripts": {
|
|
112
112
|
"build": "tsc -p tsconfig.json && tsc -p tsconfig.typecheck.json && node postbuild.mjs",
|