@box/metadata-template-editor 2.2.21 → 2.2.22
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/chunks/levels-chain.js +3 -8
- package/dist/chunks/metadata-template-editor-form.js +20 -25
- package/dist/chunks/metadata-template-editor.js +2 -6
- package/dist/chunks/sortable-option-list.js +8 -9
- package/dist/chunks/taxonomy-field-configuration.js +1 -4
- package/dist/chunks/taxonomy-selector.js +5 -6
- package/dist/styles/levels-chain.css +1 -1
- package/dist/styles/metadata-template-editor-form.css +1 -1
- package/dist/styles/metadata-template-editor.css +1 -1
- package/dist/styles/sortable-option-list.css +1 -1
- package/dist/styles/taxonomy-field-configuration.css +1 -1
- package/dist/styles/taxonomy-selector.css +1 -1
- package/package.json +6 -6
|
@@ -7,10 +7,7 @@ import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
|
7
7
|
import { useEffect as c, useLayoutEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
8
8
|
import { IconIconOnLightSecondary as p } from "@box/blueprint-web-assets/tokens/tokens";
|
|
9
9
|
import { ArrowRight as m } from "@box/blueprint-web-assets/icons/Line";
|
|
10
|
-
import '../styles/levels-chain.css';var h = {
|
|
11
|
-
levelsChain: "_levelsChain_1wuki_1",
|
|
12
|
-
hiddenLevelsButton: "_hiddenLevelsButton_1wuki_11"
|
|
13
|
-
};
|
|
10
|
+
import '../styles/levels-chain.css';var h = { levelsChain: "_levelsChain_bbgph_1" };
|
|
14
11
|
function g(e) {
|
|
15
12
|
let t = Math.ceil(e.length / 2);
|
|
16
13
|
return [e.slice(0, t), e.slice(t)];
|
|
@@ -79,9 +76,8 @@ var _ = ({ levels: _ = [], selectedLevels: v = [] }) => {
|
|
|
79
76
|
y.map((e, n) => {
|
|
80
77
|
let r = x && n >= y.length - F;
|
|
81
78
|
return /* @__PURE__ */ s("li", {
|
|
82
|
-
className: h.left,
|
|
83
|
-
style: { display: r ? "none" : void 0 },
|
|
84
79
|
"aria-hidden": r,
|
|
80
|
+
style: { display: r ? "none" : void 0 },
|
|
85
81
|
children: [/* @__PURE__ */ o(t, {
|
|
86
82
|
value: e.name,
|
|
87
83
|
selected: v.includes(e.level)
|
|
@@ -110,9 +106,8 @@ var _ = ({ levels: _ = [], selectedLevels: v = [] }) => {
|
|
|
110
106
|
b.map((e, n) => {
|
|
111
107
|
let r = x && n < I;
|
|
112
108
|
return /* @__PURE__ */ s("li", {
|
|
113
|
-
className: h.right,
|
|
114
|
-
style: { display: r ? "none" : void 0 },
|
|
115
109
|
"aria-hidden": r,
|
|
110
|
+
style: { display: r ? "none" : void 0 },
|
|
116
111
|
children: [/* @__PURE__ */ o(t, {
|
|
117
112
|
value: e.name,
|
|
118
113
|
selected: v.includes(e.level)
|
|
@@ -13,12 +13,11 @@ import b from "clsx";
|
|
|
13
13
|
import { Form as x, useFormikContext as ee } from "formik";
|
|
14
14
|
import { NoTemplates as S } from "@box/blueprint-web-assets/illustrations/Medium";
|
|
15
15
|
import '../styles/metadata-template-editor-form.css';var C = {
|
|
16
|
-
form: "
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
fieldsHeader: "_fieldsHeader_1f0e7_35"
|
|
16
|
+
form: "_form_1r59b_1",
|
|
17
|
+
fields: "_fields_1r59b_10",
|
|
18
|
+
emptyFields: "_emptyFields_1r59b_16",
|
|
19
|
+
actions: "_actions_1r59b_21",
|
|
20
|
+
fieldsHeader: "_fieldsHeader_1r59b_28"
|
|
22
21
|
}, w = "bodyDefaultBold", T = "h2", E = "https://developer.box.com/guides/metadata/fields/", D = ({ formId: D, onCancel: O, taxonomyOptions: k, fetchTaxonomies: A, hideActions: te, isEditMode: ne, readOnly: j = !1, onDirtyStateChange: M, onValidationChange: N, fieldExtensions: P }) => {
|
|
23
22
|
let F = p(), { errors: I, values: L, setFieldValue: R, setFieldTouched: z, isSubmitting: B, isValid: V, handleChange: H, submitCount: U, dirty: W, touched: G } = ee(), K = y(null), q = y(!1), J = () => {
|
|
24
23
|
q.current = !0;
|
|
@@ -54,9 +53,8 @@ import '../styles/metadata-template-editor-form.css';var C = {
|
|
|
54
53
|
fetchTaxonomies: A,
|
|
55
54
|
readOnly: !0
|
|
56
55
|
}) : L.fields.length === 0 ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(n, { onFieldAdd: Z }), /* @__PURE__ */ h(l, {
|
|
57
|
-
isExternal: !0,
|
|
58
|
-
className: C.fieldsLearnMoreLink,
|
|
59
56
|
href: E,
|
|
57
|
+
isExternal: !0,
|
|
60
58
|
target: "_blank",
|
|
61
59
|
children: /* @__PURE__ */ h(f, { ...o.fieldsLearnMore })
|
|
62
60
|
})] }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(a, {
|
|
@@ -73,23 +71,20 @@ import '../styles/metadata-template-editor-form.css';var C = {
|
|
|
73
71
|
id: D,
|
|
74
72
|
className: C.form,
|
|
75
73
|
children: [
|
|
76
|
-
/* @__PURE__ */ h("div", {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
readOnly: j
|
|
91
|
-
})
|
|
92
|
-
}),
|
|
74
|
+
/* @__PURE__ */ h("div", { children: /* @__PURE__ */ h(d, {
|
|
75
|
+
name: "displayName",
|
|
76
|
+
label: F.formatMessage(o.templateName),
|
|
77
|
+
placeholder: F.formatMessage(o.templateNameDescription),
|
|
78
|
+
value: L.displayName,
|
|
79
|
+
error: !j && G.displayName && I.displayName ? I.displayName : void 0,
|
|
80
|
+
onChange: (e) => {
|
|
81
|
+
H(e);
|
|
82
|
+
},
|
|
83
|
+
onPointerDown: J,
|
|
84
|
+
onKeyDown: J,
|
|
85
|
+
onBlur: Y,
|
|
86
|
+
readOnly: j
|
|
87
|
+
}) }),
|
|
93
88
|
/* @__PURE__ */ g("div", {
|
|
94
89
|
className: C.fieldsHeader,
|
|
95
90
|
children: [/* @__PURE__ */ h(u, {
|
|
@@ -16,12 +16,8 @@ import { ArrowsRotating as b } from "@box/blueprint-web-assets/icons/Line";
|
|
|
16
16
|
import { Formik as x } from "formik";
|
|
17
17
|
import { ErrorState404 as S } from "@box/blueprint-web-assets/illustrations/Medium";
|
|
18
18
|
import '../styles/metadata-template-editor.css';var C = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
error: "_error_1o2vk_15",
|
|
22
|
-
fields: "_fields_1o2vk_24",
|
|
23
|
-
addField: "_addField_1o2vk_30",
|
|
24
|
-
actions: "_actions_1o2vk_34"
|
|
19
|
+
loading: "_loading_fd3t9_1",
|
|
20
|
+
error: "_error_fd3t9_8"
|
|
25
21
|
}, ne = {
|
|
26
22
|
displayName: "",
|
|
27
23
|
templateKey: "",
|
|
@@ -13,15 +13,14 @@ import { DndContext as _, DragOverlay as v, KeyboardSensor as y, PointerSensor a
|
|
|
13
13
|
import { SortableContext as ee, arrayMove as T, sortableKeyboardCoordinates as te, useSortable as E, verticalListSortingStrategy as D } from "@dnd-kit/sortable";
|
|
14
14
|
import { CSS as O } from "@dnd-kit/utilities";
|
|
15
15
|
import '../styles/sortable-option-list.css';var k = {
|
|
16
|
-
sortableOptionList: "
|
|
17
|
-
option: "
|
|
18
|
-
editable: "
|
|
19
|
-
dragging: "
|
|
20
|
-
dragHandle: "
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
optionDragOverlay: "_optionDragOverlay_1cieq_58"
|
|
16
|
+
sortableOptionList: "_sortableOptionList_dhce1_1",
|
|
17
|
+
option: "_option_dhce1_9",
|
|
18
|
+
editable: "_editable_dhce1_9",
|
|
19
|
+
dragging: "_dragging_dhce1_22",
|
|
20
|
+
dragHandle: "_dragHandle_dhce1_26",
|
|
21
|
+
input: "_input_dhce1_41",
|
|
22
|
+
deleteButtonContainer: "_deleteButtonContainer_dhce1_47",
|
|
23
|
+
optionDragOverlay: "_optionDragOverlay_dhce1_53"
|
|
25
24
|
};
|
|
26
25
|
function ne(e, t, n, r, i, a) {
|
|
27
26
|
let o = t?.dropdown?.options?.[n] && typeof e == "object" && !!e && typeof e.dropdown == "object" && e.dropdown?.options?.[n]?.key;
|
|
@@ -12,10 +12,7 @@ import { useIntl as m } from "react-intl";
|
|
|
12
12
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
13
13
|
import { Caret as v } from "@box/blueprint-web-assets/icons/Fill";
|
|
14
14
|
import { useEffect as y, useMemo as b } from "react";
|
|
15
|
-
import '../styles/taxonomy-field-configuration.css';var x = {
|
|
16
|
-
taxonomyFieldConfiguration: "_taxonomyFieldConfiguration_ylhrs_1",
|
|
17
|
-
responsePlaceholder: "_responsePlaceholder_ylhrs_8"
|
|
18
|
-
}, S = () => {
|
|
15
|
+
import '../styles/taxonomy-field-configuration.css';var x = { taxonomyFieldConfiguration: "_taxonomyFieldConfiguration_1smhd_1" }, S = () => {
|
|
19
16
|
let { formatMessage: S } = m(), { values: C, errors: w, touched: T, setFieldValue: E } = t(), { onTaxonomySelect: D } = o({
|
|
20
17
|
values: C,
|
|
21
18
|
setFieldValue: E
|
|
@@ -6,12 +6,11 @@ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
|
6
6
|
import { Plus as d } from "@box/blueprint-web-assets/icons/Fill";
|
|
7
7
|
import { useState as f } from "react";
|
|
8
8
|
import '../styles/taxonomy-selector.css';var p = {
|
|
9
|
-
taxonomySelectorLabel: "
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
statusContainer: "_statusContainer_b3aww_30"
|
|
9
|
+
taxonomySelectorLabel: "_taxonomySelectorLabel_fuxhs_1",
|
|
10
|
+
listWrapper: "_listWrapper_fuxhs_6",
|
|
11
|
+
listWrapperWithPadding: "_listWrapperWithPadding_fuxhs_11",
|
|
12
|
+
taxonomyItem: "_taxonomyItem_fuxhs_16",
|
|
13
|
+
statusContainer: "_statusContainer_fuxhs_22"
|
|
15
14
|
}, m = ({ data: m, onClick: h, onSearchValue: g, triggerButton: _, disabled: v, resetValueOnHide: y }) => {
|
|
16
15
|
let { formatMessage: b } = s(), { status: x, onSelectorOpen: S } = e(), [C, w] = f(""), [T, E] = f(!1), D = (e) => {
|
|
17
16
|
w(e), g(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._levelsChain_bbgph_1{white-space:nowrap;align-items:center;gap:11px;width:100%;margin:0;padding:0;display:flex;overflow:hidden}._levelsChain_bbgph_1 li{align-items:center;gap:8px;display:flex}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._form_1r59b_1{gap:var(--space-4);flex-direction:column;flex:1;max-width:620px;height:100%;display:flex}._fields_1r59b_10{gap:var(--space-4);flex-direction:column;display:flex}._emptyFields_1r59b_16{flex-grow:1;justify-content:space-around}._actions_1r59b_21{justify-content:flex-end;gap:var(--space-3);padding-top:var(--space-2);display:flex}._fieldsHeader_1r59b_28{align-items:center;gap:var(--space-2);justify-content:space-between;display:flex}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._loading_fd3t9_1{padding:var(--space-8) 0;justify-content:center;align-items:center;display:flex}._error_fd3t9_8{align-items:center;gap:var(--space-4);padding:var(--space-8) 0;text-align:center;flex-direction:column;display:flex}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._sortableOptionList_dhce1_1{max-height:190px;margin:0;padding:0;list-style:none;overflow:auto}._option_dhce1_9._editable_dhce1_9{gap:var(--space-05);grid-template-rows:auto auto;grid-template-columns:auto 1fr auto;align-items:start;display:grid}._option_dhce1_9 svg{pointer-events:none}._option_dhce1_9:not(:last-child){margin-bottom:var(--space-2)}._option_dhce1_9._dragging_dhce1_22{opacity:0}._dragHandle_dhce1_26{width:20px;padding:var(--space-3) 0;cursor:grab;touch-action:none;grid-area:1/1;justify-content:center;align-items:center;display:flex}._dragHandle_dhce1_26:active{cursor:grabbing}._input_dhce1_41+span{margin-top:var(--space-1);grid-area:2/2}._deleteButtonContainer_dhce1_47{padding:var(--space-2) 0;grid-area:1/3}._optionDragOverlay_dhce1_53{background-color:var(--surface-surface-on-light);border-radius:var(--border-radius-small)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._taxonomyFieldConfiguration_1smhd_1{gap:var(--space-4);grid-template-rows:auto;grid-template-columns:1fr;display:grid}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._taxonomySelectorLabel_fuxhs_1{padding:var(--space-2) var(--space-3);display:block}._listWrapper_fuxhs_6{max-height:200px;overflow-y:auto}._listWrapperWithPadding_fuxhs_11{padding:var(--space-2);min-width:150px}._taxonomyItem_fuxhs_16{text-align:left;justify-content:flex-start;width:100%}._statusContainer_fuxhs_22{justify-content:center;align-items:center;gap:var(--space-2);flex-direction:column;min-width:190px;min-height:80px;display:flex}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-template-editor",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.22",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@box/blueprint-web": "^16.12.
|
|
7
|
-
"@box/blueprint-web-assets": "^5.5.
|
|
6
|
+
"@box/blueprint-web": "^16.12.1",
|
|
7
|
+
"@box/blueprint-web-assets": "^5.5.8",
|
|
8
8
|
"@dnd-kit/core": "^6.1.0",
|
|
9
9
|
"@dnd-kit/sortable": "^8.0.0",
|
|
10
10
|
"@dnd-kit/utilities": "^3.2.2",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"yup": "^1.6.1"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@box/blueprint-web": "^16.12.
|
|
21
|
-
"@box/blueprint-web-assets": "^5.5.
|
|
20
|
+
"@box/blueprint-web": "^16.12.1",
|
|
21
|
+
"@box/blueprint-web-assets": "^5.5.8",
|
|
22
22
|
"@box/eslint-plugin-blueprint": "2.1.10",
|
|
23
|
-
"@box/storybook-utils": "1.1.
|
|
23
|
+
"@box/storybook-utils": "1.1.32",
|
|
24
24
|
"@dnd-kit/core": "^6.1.0",
|
|
25
25
|
"@dnd-kit/sortable": "^8.0.0",
|
|
26
26
|
"@dnd-kit/utilities": "^3.2.2",
|