@byline/ui 2.5.2 → 2.6.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/dist/dnd/draggable-sortable/demo/draggable-list-demo.js +1 -1
- package/dist/react.d.ts +18 -54
- package/dist/react.js +0 -35
- package/dist/uikit.d.ts +1 -0
- package/dist/uikit.js +1 -0
- package/package.json +2 -8
- package/src/dnd/draggable-sortable/demo/draggable-list-demo.tsx +1 -1
- package/src/react.ts +20 -68
- package/src/uikit.ts +1 -0
- package/dist/admin/group.d.ts +0 -27
- package/dist/admin/group.js +0 -14
- package/dist/admin/group.module.js +0 -6
- package/dist/admin/group_module.css +0 -19
- package/dist/admin/row.d.ts +0 -25
- package/dist/admin/row.js +0 -8
- package/dist/admin/row.module.js +0 -5
- package/dist/admin/row_module.css +0 -18
- package/dist/admin/tabs.d.ts +0 -25
- package/dist/admin/tabs.js +0 -35
- package/dist/admin/tabs.module.js +0 -10
- package/dist/admin/tabs_module.css +0 -68
- package/dist/fields/array/array-field.d.ts +0 -14
- package/dist/fields/array/array-field.js +0 -176
- package/dist/fields/array/array-field.module.js +0 -11
- package/dist/fields/array/array-field_module.css +0 -32
- package/dist/fields/blocks/blocks-field.d.ts +0 -13
- package/dist/fields/blocks/blocks-field.js +0 -244
- package/dist/fields/blocks/blocks-field.module.js +0 -26
- package/dist/fields/blocks/blocks-field_module.css +0 -107
- package/dist/fields/checkbox/checkbox-field.d.ts +0 -16
- package/dist/fields/checkbox/checkbox-field.js +0 -28
- package/dist/fields/checkbox/checkbox-field.module.js +0 -6
- package/dist/fields/checkbox/checkbox-field_module.css +0 -4
- package/dist/fields/column-formatter.d.ts +0 -20
- package/dist/fields/column-formatter.js +0 -15
- package/dist/fields/date-time-formatter.d.ts +0 -16
- package/dist/fields/date-time-formatter.js +0 -8
- package/dist/fields/datetime/datetime-field.d.ts +0 -16
- package/dist/fields/datetime/datetime-field.js +0 -37
- package/dist/fields/datetime/datetime-field.module.js +0 -5
- package/dist/fields/datetime/datetime-field_module.css +0 -4
- package/dist/fields/draggable-context-menu.d.ts +0 -6
- package/dist/fields/draggable-context-menu.js +0 -83
- package/dist/fields/draggable-context-menu.module.js +0 -15
- package/dist/fields/draggable-context-menu_module.css +0 -91
- package/dist/fields/field-helpers.d.ts +0 -26
- package/dist/fields/field-helpers.js +0 -50
- package/dist/fields/field-renderer.d.ts +0 -37
- package/dist/fields/field-renderer.js +0 -206
- package/dist/fields/field-renderer.module.js +0 -8
- package/dist/fields/field-renderer_module.css +0 -11
- package/dist/fields/file/file-field.d.ts +0 -19
- package/dist/fields/file/file-field.js +0 -226
- package/dist/fields/file/file-field.module.js +0 -18
- package/dist/fields/file/file-field_module.css +0 -131
- package/dist/fields/file/file-upload-field.d.ts +0 -21
- package/dist/fields/file/file-upload-field.js +0 -128
- package/dist/fields/file/file-upload-field.module.js +0 -15
- package/dist/fields/file/file-upload-field_module.css +0 -74
- package/dist/fields/group/group-field.d.ts +0 -15
- package/dist/fields/group/group-field.js +0 -59
- package/dist/fields/group/group-field.module.js +0 -9
- package/dist/fields/group/group-field_module.css +0 -27
- package/dist/fields/image/image-field.d.ts +0 -19
- package/dist/fields/image/image-field.js +0 -242
- package/dist/fields/image/image-field.module.js +0 -22
- package/dist/fields/image/image-field_module.css +0 -121
- package/dist/fields/image/image-upload-field.d.ts +0 -21
- package/dist/fields/image/image-upload-field.js +0 -187
- package/dist/fields/image/image-upload-field.module.js +0 -19
- package/dist/fields/image/image-upload-field_module.css +0 -92
- package/dist/fields/local-date-time.d.ts +0 -27
- package/dist/fields/local-date-time.js +0 -49
- package/dist/fields/locale-badge.d.ts +0 -18
- package/dist/fields/locale-badge.js +0 -10
- package/dist/fields/locale-badge.module.js +0 -5
- package/dist/fields/locale-badge_module.css +0 -27
- package/dist/fields/numerical/numerical-field.d.ts +0 -18
- package/dist/fields/numerical/numerical-field.js +0 -74
- package/dist/fields/relation/relation-display.d.ts +0 -40
- package/dist/fields/relation/relation-display.js +0 -58
- package/dist/fields/relation/relation-display.module.js +0 -9
- package/dist/fields/relation/relation-display_module.css +0 -21
- package/dist/fields/relation/relation-field.d.ts +0 -18
- package/dist/fields/relation/relation-field.js +0 -146
- package/dist/fields/relation/relation-field.module.js +0 -13
- package/dist/fields/relation/relation-field_module.css +0 -62
- package/dist/fields/relation/relation-picker.d.ts +0 -49
- package/dist/fields/relation/relation-picker.js +0 -233
- package/dist/fields/relation/relation-picker.module.js +0 -26
- package/dist/fields/relation/relation-picker_module.css +0 -124
- package/dist/fields/relation/relation-summary.d.ts +0 -31
- package/dist/fields/relation/relation-summary.js +0 -50
- package/dist/fields/relation/relation-summary.module.js +0 -11
- package/dist/fields/relation/relation-summary_module.css +0 -37
- package/dist/fields/select/select-field.d.ts +0 -16
- package/dist/fields/select/select-field.js +0 -50
- package/dist/fields/select/select-field.module.js +0 -5
- package/dist/fields/select/select-field_module.css +0 -4
- package/dist/fields/sortable-item.d.ts +0 -15
- package/dist/fields/sortable-item.js +0 -80
- package/dist/fields/sortable-item.module.js +0 -22
- package/dist/fields/sortable-item_module.css +0 -124
- package/dist/fields/text/text-field.d.ts +0 -20
- package/dist/fields/text/text-field.js +0 -104
- package/dist/fields/text/text-field.module.js +0 -6
- package/dist/fields/text/text-field_module.css +0 -5
- package/dist/fields/text-area/text-area-field.d.ts +0 -20
- package/dist/fields/text-area/text-area-field.js +0 -105
- package/dist/fields/text-area/text-area-field.module.js +0 -6
- package/dist/fields/text-area/text-area-field_module.css +0 -5
- package/dist/fields/use-field-change-handler.d.ts +0 -23
- package/dist/fields/use-field-change-handler.js +0 -52
- package/dist/forms/document-actions.d.ts +0 -48
- package/dist/forms/document-actions.js +0 -469
- package/dist/forms/document-actions.module.js +0 -34
- package/dist/forms/document-actions_module.css +0 -118
- package/dist/forms/form-context.d.ts +0 -89
- package/dist/forms/form-context.js +0 -466
- package/dist/forms/form-renderer.d.ts +0 -98
- package/dist/forms/form-renderer.js +0 -591
- package/dist/forms/form-renderer.module.js +0 -46
- package/dist/forms/form-renderer_module.css +0 -245
- package/dist/forms/navigation-guard.d.ts +0 -54
- package/dist/forms/navigation-guard.js +0 -22
- package/dist/forms/path-widget.d.ts +0 -36
- package/dist/forms/path-widget.js +0 -107
- package/dist/forms/path-widget.module.js +0 -8
- package/dist/forms/path-widget_module.css +0 -29
- package/dist/forms/upload-executor.d.ts +0 -57
- package/dist/forms/upload-executor.js +0 -92
- package/dist/services/field-services-context.d.ts +0 -16
- package/dist/services/field-services-context.js +0 -13
- package/dist/services/field-services-types.d.ts +0 -63
- package/dist/services/field-services-types.js +0 -1
- package/dist/widgets/diff-viewer/diff-modal.d.ts +0 -22
- package/dist/widgets/diff-viewer/diff-modal.js +0 -146
- package/dist/widgets/diff-viewer/diff-modal.module.js +0 -14
- package/dist/widgets/diff-viewer/diff-modal_module.css +0 -56
- package/dist/widgets/status-badge/status-badge.d.ts +0 -25
- package/dist/widgets/status-badge/status-badge.js +0 -35
- package/dist/widgets/status-badge/status-badge.module.js +0 -7
- package/dist/widgets/status-badge/status-badge_module.css +0 -20
- package/src/admin/group.module.css +0 -41
- package/src/admin/group.tsx +0 -40
- package/src/admin/row.module.css +0 -32
- package/src/admin/row.tsx +0 -33
- package/src/admin/tabs.module.css +0 -107
- package/src/admin/tabs.tsx +0 -82
- package/src/fields/array/array-field.module.css +0 -48
- package/src/fields/array/array-field.tsx +0 -266
- package/src/fields/blocks/blocks-field.module.css +0 -148
- package/src/fields/blocks/blocks-field.tsx +0 -312
- package/src/fields/checkbox/checkbox-field.module.css +0 -4
- package/src/fields/checkbox/checkbox-field.tsx +0 -54
- package/src/fields/column-formatter.tsx +0 -31
- package/src/fields/date-time-formatter.tsx +0 -22
- package/src/fields/datetime/datetime-field.module.css +0 -13
- package/src/fields/datetime/datetime-field.tsx +0 -54
- package/src/fields/draggable-context-menu.module.css +0 -127
- package/src/fields/draggable-context-menu.tsx +0 -85
- package/src/fields/field-helpers.ts +0 -69
- package/src/fields/field-renderer.module.css +0 -22
- package/src/fields/field-renderer.tsx +0 -288
- package/src/fields/file/file-field.module.css +0 -153
- package/src/fields/file/file-field.tsx +0 -271
- package/src/fields/file/file-upload-field.module.css +0 -101
- package/src/fields/file/file-upload-field.tsx +0 -183
- package/src/fields/group/group-field.module.css +0 -43
- package/src/fields/group/group-field.tsx +0 -84
- package/src/fields/image/image-field.module.css +0 -155
- package/src/fields/image/image-field.tsx +0 -291
- package/src/fields/image/image-upload-field.module.css +0 -123
- package/src/fields/image/image-upload-field.tsx +0 -270
- package/src/fields/local-date-time.tsx +0 -88
- package/src/fields/locale-badge.module.css +0 -37
- package/src/fields/locale-badge.tsx +0 -32
- package/src/fields/numerical/numerical-field.tsx +0 -114
- package/src/fields/relation/relation-display.module.css +0 -36
- package/src/fields/relation/relation-display.tsx +0 -130
- package/src/fields/relation/relation-field.module.css +0 -83
- package/src/fields/relation/relation-field.tsx +0 -206
- package/src/fields/relation/relation-picker.module.css +0 -168
- package/src/fields/relation/relation-picker.tsx +0 -325
- package/src/fields/relation/relation-summary.module.css +0 -55
- package/src/fields/relation/relation-summary.tsx +0 -123
- package/src/fields/select/select-field.module.css +0 -13
- package/src/fields/select/select-field.tsx +0 -61
- package/src/fields/sortable-item.module.css +0 -167
- package/src/fields/sortable-item.tsx +0 -101
- package/src/fields/text/text-field.module.css +0 -13
- package/src/fields/text/text-field.tsx +0 -146
- package/src/fields/text-area/text-area-field.module.css +0 -13
- package/src/fields/text-area/text-area-field.tsx +0 -147
- package/src/fields/use-field-change-handler.ts +0 -112
- package/src/forms/document-actions.module.css +0 -160
- package/src/forms/document-actions.tsx +0 -487
- package/src/forms/form-context.tsx +0 -704
- package/src/forms/form-renderer.module.css +0 -321
- package/src/forms/form-renderer.tsx +0 -888
- package/src/forms/navigation-guard.tsx +0 -98
- package/src/forms/path-widget.module.css +0 -41
- package/src/forms/path-widget.test.tsx +0 -217
- package/src/forms/path-widget.tsx +0 -181
- package/src/forms/upload-executor.ts +0 -190
- package/src/services/field-services-context.tsx +0 -35
- package/src/services/field-services-types.ts +0 -68
- package/src/widgets/diff-viewer/diff-modal.module.css +0 -79
- package/src/widgets/diff-viewer/diff-modal.tsx +0 -184
- package/src/widgets/status-badge/status-badge.module.css +0 -31
- package/src/widgets/status-badge/status-badge.tsx +0 -69
|
@@ -1,469 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import classnames from "classnames";
|
|
5
|
-
import { Button, Checkbox, CloseIcon, DeleteIcon, Dropdown, EllipsisIcon, IconButton, Modal, Select } from "../uikit.js";
|
|
6
|
-
import document_actions_module from "./document-actions.module.js";
|
|
7
|
-
const DUPLICATE_TITLE_SUFFIX = ' (copy)';
|
|
8
|
-
function DocumentActions({ publishedVersion, onUnpublish, onDelete, onDuplicate, sourceTitle, onCopyToLocale, sourceLocale, contentLocales }) {
|
|
9
|
-
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
|
|
10
|
-
const [showDuplicateConfirm, setShowDuplicateConfirm] = useState(false);
|
|
11
|
-
const [duplicateBusy, setDuplicateBusy] = useState(false);
|
|
12
|
-
const availableTargetLocales = (contentLocales ?? []).filter((loc)=>loc.code !== sourceLocale);
|
|
13
|
-
const copyToLocaleAvailable = null != onCopyToLocale && availableTargetLocales.length > 0;
|
|
14
|
-
const [showCopyToLocaleConfirm, setShowCopyToLocaleConfirm] = useState(false);
|
|
15
|
-
const [copyToLocaleBusy, setCopyToLocaleBusy] = useState(false);
|
|
16
|
-
const [copyTargetLocale, setCopyTargetLocale] = useState(availableTargetLocales[0]?.code ?? '');
|
|
17
|
-
const [copyOverwrite, setCopyOverwrite] = useState(false);
|
|
18
|
-
const handleOnDelete = ()=>{
|
|
19
|
-
setShowDeleteConfirm(false);
|
|
20
|
-
if (onDelete) onDelete();
|
|
21
|
-
};
|
|
22
|
-
const handleOnDuplicate = async ()=>{
|
|
23
|
-
if (!onDuplicate) return;
|
|
24
|
-
setDuplicateBusy(true);
|
|
25
|
-
try {
|
|
26
|
-
await onDuplicate();
|
|
27
|
-
setShowDuplicateConfirm(false);
|
|
28
|
-
} finally{
|
|
29
|
-
setDuplicateBusy(false);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
const handleOpenCopyToLocale = ()=>{
|
|
33
|
-
setCopyTargetLocale(availableTargetLocales[0]?.code ?? '');
|
|
34
|
-
setCopyOverwrite(false);
|
|
35
|
-
setShowCopyToLocaleConfirm(true);
|
|
36
|
-
};
|
|
37
|
-
const handleOnCopyToLocale = async ()=>{
|
|
38
|
-
if (!onCopyToLocale || !copyTargetLocale) return;
|
|
39
|
-
setCopyToLocaleBusy(true);
|
|
40
|
-
try {
|
|
41
|
-
await onCopyToLocale({
|
|
42
|
-
targetLocale: copyTargetLocale,
|
|
43
|
-
overwrite: copyOverwrite
|
|
44
|
-
});
|
|
45
|
-
setShowCopyToLocaleConfirm(false);
|
|
46
|
-
} finally{
|
|
47
|
-
setCopyToLocaleBusy(false);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const duplicatePreviewBefore = sourceTitle ?? '';
|
|
51
|
-
const duplicatePreviewAfter = (sourceTitle ?? '') + DUPLICATE_TITLE_SUFFIX;
|
|
52
|
-
const sourceLocaleLabel = contentLocales?.find((loc)=>loc.code === sourceLocale)?.label ?? sourceLocale ?? '';
|
|
53
|
-
return /*#__PURE__*/ jsxs(Fragment, {
|
|
54
|
-
children: [
|
|
55
|
-
/*#__PURE__*/ jsxs(Dropdown.Root, {
|
|
56
|
-
children: [
|
|
57
|
-
/*#__PURE__*/ jsx(Dropdown.Trigger, {
|
|
58
|
-
render: /*#__PURE__*/ jsx(IconButton, {
|
|
59
|
-
variant: "text",
|
|
60
|
-
intent: "noeffect",
|
|
61
|
-
size: "sm"
|
|
62
|
-
}),
|
|
63
|
-
children: /*#__PURE__*/ jsx(EllipsisIcon, {
|
|
64
|
-
className: classnames('byline-form-actions-icon', document_actions_module.icon),
|
|
65
|
-
width: "15px",
|
|
66
|
-
height: "15px"
|
|
67
|
-
})
|
|
68
|
-
}),
|
|
69
|
-
/*#__PURE__*/ jsx(Dropdown.Portal, {
|
|
70
|
-
children: /*#__PURE__*/ jsxs(Dropdown.Content, {
|
|
71
|
-
className: classnames('byline-form-actions-menu', document_actions_module.menu),
|
|
72
|
-
align: "end",
|
|
73
|
-
"data-side": "top",
|
|
74
|
-
sideOffset: 10,
|
|
75
|
-
children: [
|
|
76
|
-
copyToLocaleAvailable && /*#__PURE__*/ jsx(Dropdown.Item, {
|
|
77
|
-
onClick: handleOpenCopyToLocale,
|
|
78
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
79
|
-
className: classnames('byline-form-actions-item', document_actions_module.item),
|
|
80
|
-
children: /*#__PURE__*/ jsx("span", {
|
|
81
|
-
className: classnames('byline-form-actions-item-text', document_actions_module["item-text"]),
|
|
82
|
-
children: /*#__PURE__*/ jsx("button", {
|
|
83
|
-
type: "button",
|
|
84
|
-
children: "Copy to Locale"
|
|
85
|
-
})
|
|
86
|
-
})
|
|
87
|
-
})
|
|
88
|
-
}),
|
|
89
|
-
onDuplicate && /*#__PURE__*/ jsx(Dropdown.Item, {
|
|
90
|
-
onClick: ()=>{
|
|
91
|
-
setShowDuplicateConfirm(true);
|
|
92
|
-
},
|
|
93
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
94
|
-
className: classnames('byline-form-actions-item', document_actions_module.item),
|
|
95
|
-
children: /*#__PURE__*/ jsx("span", {
|
|
96
|
-
className: classnames('byline-form-actions-item-text', document_actions_module["item-text"]),
|
|
97
|
-
children: /*#__PURE__*/ jsx("button", {
|
|
98
|
-
type: "button",
|
|
99
|
-
children: "Duplicate"
|
|
100
|
-
})
|
|
101
|
-
})
|
|
102
|
-
})
|
|
103
|
-
}),
|
|
104
|
-
/*#__PURE__*/ jsx(Dropdown.Separator, {}),
|
|
105
|
-
/*#__PURE__*/ jsx(Dropdown.Item, {
|
|
106
|
-
onClick: ()=>{
|
|
107
|
-
setShowDeleteConfirm(true);
|
|
108
|
-
},
|
|
109
|
-
children: /*#__PURE__*/ jsxs("div", {
|
|
110
|
-
className: classnames('byline-form-actions-item', document_actions_module.item),
|
|
111
|
-
children: [
|
|
112
|
-
/*#__PURE__*/ jsx("span", {
|
|
113
|
-
className: classnames('byline-form-actions-item-icon', document_actions_module["item-icon"]),
|
|
114
|
-
children: /*#__PURE__*/ jsx(DeleteIcon, {
|
|
115
|
-
width: "16px",
|
|
116
|
-
height: "16px"
|
|
117
|
-
})
|
|
118
|
-
}),
|
|
119
|
-
/*#__PURE__*/ jsx("span", {
|
|
120
|
-
className: classnames('byline-form-actions-item-text', document_actions_module["item-text"]),
|
|
121
|
-
children: /*#__PURE__*/ jsx("button", {
|
|
122
|
-
type: "button",
|
|
123
|
-
className: classnames('byline-form-actions-delete', document_actions_module["delete"]),
|
|
124
|
-
children: "Delete"
|
|
125
|
-
})
|
|
126
|
-
})
|
|
127
|
-
]
|
|
128
|
-
})
|
|
129
|
-
})
|
|
130
|
-
]
|
|
131
|
-
})
|
|
132
|
-
})
|
|
133
|
-
]
|
|
134
|
-
}),
|
|
135
|
-
/*#__PURE__*/ jsx(Modal, {
|
|
136
|
-
isOpen: showDeleteConfirm,
|
|
137
|
-
closeOnOverlayClick: true,
|
|
138
|
-
onDismiss: ()=>{
|
|
139
|
-
setShowDeleteConfirm(false);
|
|
140
|
-
},
|
|
141
|
-
children: /*#__PURE__*/ jsxs(Modal.Container, {
|
|
142
|
-
style: {
|
|
143
|
-
maxWidth: '500px'
|
|
144
|
-
},
|
|
145
|
-
children: [
|
|
146
|
-
/*#__PURE__*/ jsxs(Modal.Header, {
|
|
147
|
-
className: classnames('byline-form-actions-modal-head', document_actions_module["modal-head"]),
|
|
148
|
-
children: [
|
|
149
|
-
/*#__PURE__*/ jsx("h3", {
|
|
150
|
-
className: classnames('byline-form-actions-modal-title', document_actions_module["modal-title"]),
|
|
151
|
-
children: "Delete Document"
|
|
152
|
-
}),
|
|
153
|
-
/*#__PURE__*/ jsx(IconButton, {
|
|
154
|
-
"arial-label": "Close",
|
|
155
|
-
size: "xs",
|
|
156
|
-
onClick: ()=>{
|
|
157
|
-
setShowDeleteConfirm(false);
|
|
158
|
-
},
|
|
159
|
-
children: /*#__PURE__*/ jsx(CloseIcon, {
|
|
160
|
-
width: "16px",
|
|
161
|
-
height: "16px",
|
|
162
|
-
svgClassName: "white-icon"
|
|
163
|
-
})
|
|
164
|
-
})
|
|
165
|
-
]
|
|
166
|
-
}),
|
|
167
|
-
/*#__PURE__*/ jsx(Modal.Content, {
|
|
168
|
-
children: /*#__PURE__*/ jsx("p", {
|
|
169
|
-
children: "Warning: This action cannot be undone. Are you sure you want to delete this document?"
|
|
170
|
-
})
|
|
171
|
-
}),
|
|
172
|
-
/*#__PURE__*/ jsxs(Modal.Actions, {
|
|
173
|
-
children: [
|
|
174
|
-
/*#__PURE__*/ jsx("button", {
|
|
175
|
-
"data-autofocus": true,
|
|
176
|
-
type: "button",
|
|
177
|
-
tabIndex: 0,
|
|
178
|
-
className: classnames('byline-form-actions-sr-only', document_actions_module["sr-only"]),
|
|
179
|
-
children: "no action"
|
|
180
|
-
}),
|
|
181
|
-
/*#__PURE__*/ jsx(Button, {
|
|
182
|
-
size: "sm",
|
|
183
|
-
style: {
|
|
184
|
-
minWidth: '80px'
|
|
185
|
-
},
|
|
186
|
-
intent: "noeffect",
|
|
187
|
-
onClick: ()=>{
|
|
188
|
-
setShowDeleteConfirm(false);
|
|
189
|
-
},
|
|
190
|
-
children: "Cancel"
|
|
191
|
-
}),
|
|
192
|
-
/*#__PURE__*/ jsx(Button, {
|
|
193
|
-
size: "sm",
|
|
194
|
-
style: {
|
|
195
|
-
minWidth: '80px'
|
|
196
|
-
},
|
|
197
|
-
intent: "danger",
|
|
198
|
-
onClick: handleOnDelete,
|
|
199
|
-
children: "Delete"
|
|
200
|
-
})
|
|
201
|
-
]
|
|
202
|
-
})
|
|
203
|
-
]
|
|
204
|
-
})
|
|
205
|
-
}),
|
|
206
|
-
/*#__PURE__*/ jsx(Modal, {
|
|
207
|
-
isOpen: showDuplicateConfirm,
|
|
208
|
-
closeOnOverlayClick: !duplicateBusy,
|
|
209
|
-
onDismiss: ()=>{
|
|
210
|
-
if (!duplicateBusy) setShowDuplicateConfirm(false);
|
|
211
|
-
},
|
|
212
|
-
children: /*#__PURE__*/ jsxs(Modal.Container, {
|
|
213
|
-
style: {
|
|
214
|
-
maxWidth: '560px'
|
|
215
|
-
},
|
|
216
|
-
children: [
|
|
217
|
-
/*#__PURE__*/ jsxs(Modal.Header, {
|
|
218
|
-
className: classnames('byline-form-actions-modal-head', document_actions_module["modal-head"]),
|
|
219
|
-
children: [
|
|
220
|
-
/*#__PURE__*/ jsx("h3", {
|
|
221
|
-
className: classnames('byline-form-actions-modal-title', document_actions_module["modal-title"]),
|
|
222
|
-
children: "Duplicate Document"
|
|
223
|
-
}),
|
|
224
|
-
/*#__PURE__*/ jsx(IconButton, {
|
|
225
|
-
"arial-label": "Close",
|
|
226
|
-
size: "xs",
|
|
227
|
-
onClick: ()=>{
|
|
228
|
-
if (!duplicateBusy) setShowDuplicateConfirm(false);
|
|
229
|
-
},
|
|
230
|
-
children: /*#__PURE__*/ jsx(CloseIcon, {
|
|
231
|
-
width: "16px",
|
|
232
|
-
height: "16px",
|
|
233
|
-
svgClassName: "white-icon"
|
|
234
|
-
})
|
|
235
|
-
})
|
|
236
|
-
]
|
|
237
|
-
}),
|
|
238
|
-
/*#__PURE__*/ jsxs(Modal.Content, {
|
|
239
|
-
className: "prose",
|
|
240
|
-
children: [
|
|
241
|
-
/*#__PURE__*/ jsx("p", {
|
|
242
|
-
className: "m-0",
|
|
243
|
-
children: "A new document will be created with all translations (if any) cloned from this one. After the duplicate is created you should:"
|
|
244
|
-
}),
|
|
245
|
-
/*#__PURE__*/ jsxs("ul", {
|
|
246
|
-
className: classnames('byline-form-actions-list', document_actions_module.list),
|
|
247
|
-
children: [
|
|
248
|
-
/*#__PURE__*/ jsxs("li", {
|
|
249
|
-
children: [
|
|
250
|
-
"Update the title of the docuiment (including any translated versions). The title is currently suffixed with ",
|
|
251
|
-
/*#__PURE__*/ jsx("code", {
|
|
252
|
-
children: DUPLICATE_TITLE_SUFFIX.trim()
|
|
253
|
-
}),
|
|
254
|
-
"."
|
|
255
|
-
]
|
|
256
|
-
}),
|
|
257
|
-
/*#__PURE__*/ jsx("li", {
|
|
258
|
-
children: "Review the system path in the path widget — the auto-generated path will reflect the suffixed title and is unlikely to be what you want long-term."
|
|
259
|
-
})
|
|
260
|
-
]
|
|
261
|
-
}),
|
|
262
|
-
null != sourceTitle && sourceTitle.length > 0 && /*#__PURE__*/ jsxs("div", {
|
|
263
|
-
className: classnames('byline-form-actions-preview', document_actions_module.preview),
|
|
264
|
-
children: [
|
|
265
|
-
/*#__PURE__*/ jsx("div", {
|
|
266
|
-
className: classnames('byline-form-actions-preview-label', document_actions_module["preview-label"]),
|
|
267
|
-
children: "Preview (current locale):"
|
|
268
|
-
}),
|
|
269
|
-
/*#__PURE__*/ jsxs("div", {
|
|
270
|
-
className: classnames('byline-form-actions-preview-row', document_actions_module["preview-row"]),
|
|
271
|
-
children: [
|
|
272
|
-
/*#__PURE__*/ jsx("span", {
|
|
273
|
-
className: classnames('byline-form-actions-preview-before', document_actions_module["preview-before"]),
|
|
274
|
-
children: duplicatePreviewBefore
|
|
275
|
-
}),
|
|
276
|
-
/*#__PURE__*/ jsx("span", {
|
|
277
|
-
className: classnames('byline-form-actions-preview-arrow', document_actions_module["preview-arrow"]),
|
|
278
|
-
children: "→"
|
|
279
|
-
}),
|
|
280
|
-
/*#__PURE__*/ jsx("span", {
|
|
281
|
-
className: classnames('byline-form-actions-preview-after', document_actions_module["preview-after"]),
|
|
282
|
-
children: duplicatePreviewAfter
|
|
283
|
-
})
|
|
284
|
-
]
|
|
285
|
-
})
|
|
286
|
-
]
|
|
287
|
-
})
|
|
288
|
-
]
|
|
289
|
-
}),
|
|
290
|
-
/*#__PURE__*/ jsxs(Modal.Actions, {
|
|
291
|
-
children: [
|
|
292
|
-
/*#__PURE__*/ jsx("button", {
|
|
293
|
-
"data-autofocus": true,
|
|
294
|
-
type: "button",
|
|
295
|
-
tabIndex: 0,
|
|
296
|
-
className: classnames('byline-form-actions-sr-only', document_actions_module["sr-only"]),
|
|
297
|
-
children: "no action"
|
|
298
|
-
}),
|
|
299
|
-
/*#__PURE__*/ jsx(Button, {
|
|
300
|
-
size: "sm",
|
|
301
|
-
style: {
|
|
302
|
-
minWidth: '80px'
|
|
303
|
-
},
|
|
304
|
-
intent: "noeffect",
|
|
305
|
-
onClick: ()=>{
|
|
306
|
-
if (!duplicateBusy) setShowDuplicateConfirm(false);
|
|
307
|
-
},
|
|
308
|
-
disabled: duplicateBusy,
|
|
309
|
-
children: "Cancel"
|
|
310
|
-
}),
|
|
311
|
-
/*#__PURE__*/ jsx(Button, {
|
|
312
|
-
size: "sm",
|
|
313
|
-
style: {
|
|
314
|
-
minWidth: '80px'
|
|
315
|
-
},
|
|
316
|
-
intent: "primary",
|
|
317
|
-
onClick: handleOnDuplicate,
|
|
318
|
-
disabled: duplicateBusy,
|
|
319
|
-
children: duplicateBusy ? 'Duplicating...' : 'Duplicate'
|
|
320
|
-
})
|
|
321
|
-
]
|
|
322
|
-
})
|
|
323
|
-
]
|
|
324
|
-
})
|
|
325
|
-
}),
|
|
326
|
-
/*#__PURE__*/ jsx(Modal, {
|
|
327
|
-
isOpen: showCopyToLocaleConfirm,
|
|
328
|
-
closeOnOverlayClick: !copyToLocaleBusy,
|
|
329
|
-
onDismiss: ()=>{
|
|
330
|
-
if (!copyToLocaleBusy) setShowCopyToLocaleConfirm(false);
|
|
331
|
-
},
|
|
332
|
-
children: /*#__PURE__*/ jsxs(Modal.Container, {
|
|
333
|
-
style: {
|
|
334
|
-
maxWidth: '560px'
|
|
335
|
-
},
|
|
336
|
-
children: [
|
|
337
|
-
/*#__PURE__*/ jsxs(Modal.Header, {
|
|
338
|
-
className: classnames('byline-form-actions-modal-head', document_actions_module["modal-head"]),
|
|
339
|
-
children: [
|
|
340
|
-
/*#__PURE__*/ jsx("h3", {
|
|
341
|
-
className: classnames('byline-form-actions-modal-title', document_actions_module["modal-title"]),
|
|
342
|
-
children: "Copy to Locale"
|
|
343
|
-
}),
|
|
344
|
-
/*#__PURE__*/ jsx(IconButton, {
|
|
345
|
-
"arial-label": "Close",
|
|
346
|
-
size: "xs",
|
|
347
|
-
onClick: ()=>{
|
|
348
|
-
if (!copyToLocaleBusy) setShowCopyToLocaleConfirm(false);
|
|
349
|
-
},
|
|
350
|
-
children: /*#__PURE__*/ jsx(CloseIcon, {
|
|
351
|
-
width: "16px",
|
|
352
|
-
height: "16px",
|
|
353
|
-
svgClassName: "white-icon"
|
|
354
|
-
})
|
|
355
|
-
})
|
|
356
|
-
]
|
|
357
|
-
}),
|
|
358
|
-
/*#__PURE__*/ jsxs(Modal.Content, {
|
|
359
|
-
children: [
|
|
360
|
-
/*#__PURE__*/ jsx("p", {
|
|
361
|
-
children: "Copy this document's content from one locale to another. Non-localized fields are shared across locales and will not change."
|
|
362
|
-
}),
|
|
363
|
-
/*#__PURE__*/ jsxs("div", {
|
|
364
|
-
className: classnames('byline-form-actions-copy-row', document_actions_module["copy-row"]),
|
|
365
|
-
style: {
|
|
366
|
-
marginTop: 'var(--spacing-12)'
|
|
367
|
-
},
|
|
368
|
-
children: [
|
|
369
|
-
/*#__PURE__*/ jsx("span", {
|
|
370
|
-
className: classnames('byline-form-actions-copy-label', document_actions_module["copy-label"]),
|
|
371
|
-
style: {
|
|
372
|
-
fontWeight: 500
|
|
373
|
-
},
|
|
374
|
-
children: "From:\xa0"
|
|
375
|
-
}),
|
|
376
|
-
/*#__PURE__*/ jsx("span", {
|
|
377
|
-
className: classnames('byline-form-actions-copy-source', document_actions_module["copy-source"]),
|
|
378
|
-
children: sourceLocaleLabel
|
|
379
|
-
})
|
|
380
|
-
]
|
|
381
|
-
}),
|
|
382
|
-
/*#__PURE__*/ jsxs("div", {
|
|
383
|
-
className: classnames('byline-form-actions-copy-row', document_actions_module["copy-row"]),
|
|
384
|
-
style: {
|
|
385
|
-
marginTop: 'var(--spacing-12)'
|
|
386
|
-
},
|
|
387
|
-
children: [
|
|
388
|
-
/*#__PURE__*/ jsx("span", {
|
|
389
|
-
className: classnames('byline-form-actions-copy-label', document_actions_module["copy-label"]),
|
|
390
|
-
style: {
|
|
391
|
-
fontWeight: 500,
|
|
392
|
-
marginRight: 'var(--spacing-8)'
|
|
393
|
-
},
|
|
394
|
-
children: "To:"
|
|
395
|
-
}),
|
|
396
|
-
/*#__PURE__*/ jsx(Select, {
|
|
397
|
-
size: "sm",
|
|
398
|
-
ariaLabel: "Target locale",
|
|
399
|
-
value: copyTargetLocale,
|
|
400
|
-
items: availableTargetLocales.map((loc)=>({
|
|
401
|
-
value: loc.code,
|
|
402
|
-
label: loc.label
|
|
403
|
-
})),
|
|
404
|
-
onValueChange: (value)=>{
|
|
405
|
-
if (null != value) setCopyTargetLocale(value);
|
|
406
|
-
},
|
|
407
|
-
disabled: copyToLocaleBusy
|
|
408
|
-
})
|
|
409
|
-
]
|
|
410
|
-
}),
|
|
411
|
-
/*#__PURE__*/ jsx("div", {
|
|
412
|
-
className: classnames('byline-form-actions-copy-row', document_actions_module["copy-row"]),
|
|
413
|
-
style: {
|
|
414
|
-
marginTop: 'var(--spacing-16)'
|
|
415
|
-
},
|
|
416
|
-
children: /*#__PURE__*/ jsx(Checkbox, {
|
|
417
|
-
id: "copy-to-locale-overwrite",
|
|
418
|
-
name: "overwrite",
|
|
419
|
-
label: "Overwrite existing field data in target locale",
|
|
420
|
-
checked: copyOverwrite,
|
|
421
|
-
disabled: copyToLocaleBusy,
|
|
422
|
-
helpText: "Unchecked: only fill in target fields that are currently empty. Checked: replace every translated field with the source's value.",
|
|
423
|
-
onCheckedChange: (value)=>{
|
|
424
|
-
setCopyOverwrite(true === value);
|
|
425
|
-
}
|
|
426
|
-
})
|
|
427
|
-
})
|
|
428
|
-
]
|
|
429
|
-
}),
|
|
430
|
-
/*#__PURE__*/ jsxs(Modal.Actions, {
|
|
431
|
-
children: [
|
|
432
|
-
/*#__PURE__*/ jsx("button", {
|
|
433
|
-
"data-autofocus": true,
|
|
434
|
-
type: "button",
|
|
435
|
-
tabIndex: 0,
|
|
436
|
-
className: classnames('byline-form-actions-sr-only', document_actions_module["sr-only"]),
|
|
437
|
-
children: "no action"
|
|
438
|
-
}),
|
|
439
|
-
/*#__PURE__*/ jsx(Button, {
|
|
440
|
-
size: "sm",
|
|
441
|
-
style: {
|
|
442
|
-
minWidth: '80px'
|
|
443
|
-
},
|
|
444
|
-
intent: "noeffect",
|
|
445
|
-
onClick: ()=>{
|
|
446
|
-
if (!copyToLocaleBusy) setShowCopyToLocaleConfirm(false);
|
|
447
|
-
},
|
|
448
|
-
disabled: copyToLocaleBusy,
|
|
449
|
-
children: "Cancel"
|
|
450
|
-
}),
|
|
451
|
-
/*#__PURE__*/ jsx(Button, {
|
|
452
|
-
size: "sm",
|
|
453
|
-
style: {
|
|
454
|
-
minWidth: '80px'
|
|
455
|
-
},
|
|
456
|
-
intent: "primary",
|
|
457
|
-
onClick: handleOnCopyToLocale,
|
|
458
|
-
disabled: copyToLocaleBusy || !copyTargetLocale,
|
|
459
|
-
children: copyToLocaleBusy ? 'Copying...' : 'Copy'
|
|
460
|
-
})
|
|
461
|
-
]
|
|
462
|
-
})
|
|
463
|
-
]
|
|
464
|
-
})
|
|
465
|
-
})
|
|
466
|
-
]
|
|
467
|
-
});
|
|
468
|
-
}
|
|
469
|
-
export { DocumentActions };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import "./document-actions_module.css";
|
|
2
|
-
const document_actions_module = {
|
|
3
|
-
icon: "icon-s8mBo2",
|
|
4
|
-
menu: "menu-IxqAyg",
|
|
5
|
-
item: "item-k3szmy",
|
|
6
|
-
"item-icon": "item-icon-G0Twql",
|
|
7
|
-
itemIcon: "item-icon-G0Twql",
|
|
8
|
-
"item-text": "item-text-QjsRkV",
|
|
9
|
-
itemText: "item-text-QjsRkV",
|
|
10
|
-
delete: "delete-xmSRLN",
|
|
11
|
-
"modal-head": "modal-head-T7hzCI",
|
|
12
|
-
modalHead: "modal-head-T7hzCI",
|
|
13
|
-
"modal-title": "modal-title-e2sqE2",
|
|
14
|
-
modalTitle: "modal-title-e2sqE2",
|
|
15
|
-
"sr-only": "sr-only-VaKvc6",
|
|
16
|
-
srOnly: "sr-only-VaKvc6",
|
|
17
|
-
list: "list-TuqTao",
|
|
18
|
-
preview: "preview-oePPZR",
|
|
19
|
-
"preview-label": "preview-label-bvWDqG",
|
|
20
|
-
previewLabel: "preview-label-bvWDqG",
|
|
21
|
-
"preview-row": "preview-row-NyFKjX",
|
|
22
|
-
previewRow: "preview-row-NyFKjX",
|
|
23
|
-
"preview-before": "preview-before-tmxeNQ",
|
|
24
|
-
previewBefore: "preview-before-tmxeNQ",
|
|
25
|
-
"preview-arrow": "preview-arrow-plq330",
|
|
26
|
-
previewArrow: "preview-arrow-plq330",
|
|
27
|
-
"preview-after": "preview-after-pYlSUr",
|
|
28
|
-
previewAfter: "preview-after-pYlSUr",
|
|
29
|
-
"copy-row": "copy-row-EGqeNw",
|
|
30
|
-
copyRow: "copy-row-EGqeNw",
|
|
31
|
-
"copy-source": "copy-source-IV71b6",
|
|
32
|
-
copySource: "copy-source-IV71b6"
|
|
33
|
-
};
|
|
34
|
-
export default document_actions_module;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
:is(.icon-s8mBo2, .byline-form-actions-icon) {
|
|
2
|
-
color: var(--primary-500);
|
|
3
|
-
transform: rotate(90deg);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
:is(.menu-IxqAyg, .byline-form-actions-menu) {
|
|
7
|
-
min-width: 140px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
:is(.item-k3szmy, .byline-form-actions-item) {
|
|
11
|
-
margin-left: var(--spacing-8);
|
|
12
|
-
align-items: center;
|
|
13
|
-
display: flex;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
:is(.item-icon-G0Twql, .byline-form-actions-item-icon) {
|
|
17
|
-
width: 28px;
|
|
18
|
-
display: inline-block;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
:is(.item-text-QjsRkV, .byline-form-actions-item-text) {
|
|
22
|
-
width: 100%;
|
|
23
|
-
font-size: var(--font-size-sm);
|
|
24
|
-
text-align: left;
|
|
25
|
-
flex: 1;
|
|
26
|
-
display: inline-block;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
:is(.delete-xmSRLN, .byline-form-actions-delete) {
|
|
30
|
-
width: 100%;
|
|
31
|
-
color: var(--red-600);
|
|
32
|
-
text-align: left;
|
|
33
|
-
cursor: pointer;
|
|
34
|
-
background: none;
|
|
35
|
-
border: none;
|
|
36
|
-
flex: 1;
|
|
37
|
-
padding: 0;
|
|
38
|
-
line-height: 1;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
:is(.modal-head-T7hzCI, .byline-form-actions-modal-head) {
|
|
42
|
-
margin-bottom: var(--spacing-8);
|
|
43
|
-
padding-top: 1rem;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
:is(.modal-title-e2sqE2, .byline-form-actions-modal-title) {
|
|
47
|
-
margin: 0 0 var(--spacing-8) 0;
|
|
48
|
-
font-size: var(--font-size-2xl);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
:is(.sr-only-VaKvc6, .byline-form-actions-sr-only) {
|
|
52
|
-
clip: rect(0, 0, 0, 0);
|
|
53
|
-
white-space: nowrap;
|
|
54
|
-
border: 0;
|
|
55
|
-
width: 1px;
|
|
56
|
-
height: 1px;
|
|
57
|
-
margin: -1px;
|
|
58
|
-
padding: 0;
|
|
59
|
-
position: absolute;
|
|
60
|
-
overflow: hidden;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
:is(.list-TuqTao, .byline-form-actions-list) {
|
|
64
|
-
margin: var(--spacing-8) 0;
|
|
65
|
-
font-size: var(--font-size-sm);
|
|
66
|
-
padding-left: 1.25rem;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
:is(.preview-oePPZR, .byline-form-actions-preview) {
|
|
70
|
-
margin-top: var(--spacing-16);
|
|
71
|
-
padding: var(--spacing-8) var(--spacing-12);
|
|
72
|
-
background: var(--surface-2, #00000008);
|
|
73
|
-
border: 1px solid var(--border-subtle, #00000014);
|
|
74
|
-
border-radius: var(--radius-md, 4px);
|
|
75
|
-
font-size: var(--font-size-sm);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
:is(.preview-label-bvWDqG, .byline-form-actions-preview-label) {
|
|
79
|
-
margin-bottom: var(--spacing-4);
|
|
80
|
-
opacity: .75;
|
|
81
|
-
font-weight: 500;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
:is(.preview-row-NyFKjX, .byline-form-actions-preview-row) {
|
|
85
|
-
align-items: center;
|
|
86
|
-
gap: var(--spacing-8);
|
|
87
|
-
flex-wrap: wrap;
|
|
88
|
-
display: flex;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
:is(.preview-before-tmxeNQ, .byline-form-actions-preview-before) {
|
|
92
|
-
font-family: var(--font-mono, monospace);
|
|
93
|
-
opacity: .7;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
:is(.preview-arrow-plq330, .byline-form-actions-preview-arrow) {
|
|
97
|
-
opacity: .5;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
:is(.preview-after-pYlSUr, .byline-form-actions-preview-after) {
|
|
101
|
-
font-family: var(--font-mono, monospace);
|
|
102
|
-
font-weight: 500;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
:is(.copy-row-EGqeNw, .byline-form-actions-copy-row) {
|
|
106
|
-
flex-wrap: wrap;
|
|
107
|
-
align-items: center;
|
|
108
|
-
display: flex;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
:is(.copy-source-IV71b6, .byline-form-actions-copy-source) {
|
|
112
|
-
font-family: var(--font-mono, monospace);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
:is(:is([data-theme="dark"], .dark) .delete-xmSRLN, :is([data-theme="dark"], .dark) .byline-form-actions-delete) {
|
|
116
|
-
color: var(--red-400);
|
|
117
|
-
}
|
|
118
|
-
|