@arbidocs/blocks 0.4.120 → 0.4.122
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/agents/index.cjs +208 -208
- package/dist/agents/index.js +3 -3
- package/dist/{chunk-FXUQZFAN.cjs → chunk-Z2NSU7D5.cjs} +4 -4
- package/dist/{chunk-FXUQZFAN.cjs.map → chunk-Z2NSU7D5.cjs.map} +1 -1
- package/dist/{chunk-6Z7DLJU2.js → chunk-ZP4IFW2E.js} +4 -4
- package/dist/{chunk-6Z7DLJU2.js.map → chunk-ZP4IFW2E.js.map} +1 -1
- package/dist/collaboration/index.cjs +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/connect/index.cjs +15 -5
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +15 -5
- package/dist/connect/index.js.map +1 -1
- package/dist/facts/index.cjs +1 -1
- package/dist/facts/index.js +1 -1
- package/dist/files/index.cjs +1 -1
- package/dist/files/index.js +1 -1
- package/dist/index.cjs +217 -217
- package/dist/index.js +3 -3
- package/dist/shell/index.cjs +9 -9
- package/dist/shell/index.js +1 -1
- package/dist/workflow-canvas/index.cjs +10 -10
- package/dist/workflow-canvas/index.js +3 -3
- package/node_modules/@arbidocs/coedit/dist/commands.cjs +222 -12
- package/node_modules/@arbidocs/coedit/dist/commands.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/commands.d.cts +82 -5
- package/node_modules/@arbidocs/coedit/dist/commands.d.ts +82 -5
- package/node_modules/@arbidocs/coedit/dist/commands.js +217 -13
- package/node_modules/@arbidocs/coedit/dist/commands.js.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/encoding.d.cts +2 -0
- package/node_modules/@arbidocs/coedit/dist/encoding.d.ts +2 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs +27 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.js +27 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.js.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/index.cjs +27 -0
- package/node_modules/@arbidocs/coedit/dist/index.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/index.js +27 -0
- package/node_modules/@arbidocs/coedit/dist/index.js.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/{port-ip7WByvH.d.cts → port-BbN5OZHx.d.cts} +24 -1
- package/node_modules/@arbidocs/coedit/dist/{port-ip7WByvH.d.ts → port-BbN5OZHx.d.ts} +24 -1
- package/node_modules/@arbidocs/coedit/dist/server.cjs +65 -2
- package/node_modules/@arbidocs/coedit/dist/server.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/server.d.cts +1 -1
- package/node_modules/@arbidocs/coedit/dist/server.d.ts +1 -1
- package/node_modules/@arbidocs/coedit/dist/server.js +65 -2
- package/node_modules/@arbidocs/coedit/dist/server.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ export { DEFAULT_SEARCH_HIT_LABELS, SearchHit } from './chunk-A2YAC22G.js';
|
|
|
21
21
|
export { TIMELINE_ZOOM, TimelineCalendar, TimelineGantt, TimelineZoomControl, dayKey, formatSpan, monthLabel, parseIso, utcDay } from './chunk-4EZVCGRL.js';
|
|
22
22
|
import './chunk-AF6RDAJF.js';
|
|
23
23
|
export { DEFAULT_SHARE_CONTROL_LABELS, ShareControl } from './chunk-K4BGOPGG.js';
|
|
24
|
-
export { AgentAvatarField, AgentBar, AgentBarIconButton, AgentBarMenu, AgentBarNotes, AgentBarProbeAnswer, AgentBarQueuedNote, AgentBarStatus, AgentCard, AgentCreateView, AgentCreatedView, AgentCreator, AgentEditView, AgentGallery, AgentMainView, AgentSelect, AgentTypeSelector, CapabilityGrid, CapabilityTile, ConfigField, ConfigForm, ConsentActions, ConsentBulletList, ConsentCard, ConsentFootnote, ConsentHeader, ConsentMessage, ConsentNotice, ConsentPage, ConsentPermissionList, ConsentSection, ConsentStrong, ConsentText, ConversationListView, ConversationTurnSpeaker, CopyableUrl, DEFAULT_AGENT_AVATAR_FIELD_LABELS, DEFAULT_AGENT_BAR_LABELS, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_CREATOR_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_AGENT_SELECT_LABELS, DEFAULT_AGENT_STEPS_LABELS, DEFAULT_AGENT_TYPE_SELECTOR_LABELS, DEFAULT_AUTHORIZE_AGENT_LABELS, DEFAULT_CONFIG_FIELD_LABELS, DEFAULT_CONFIG_FORM_LABELS, DEFAULT_CONSENT_ACTIONS_LABELS, DEFAULT_COPYABLE_URL_LABELS, DEFAULT_NEW_THREAD_DIALOG_LABELS, DEFAULT_PILL_SELECT_LABELS, DEFAULT_RECURRENCE, DEFAULT_RECURRENCE_BUILDER_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_EDIT_FORM_LABELS, DEFAULT_SKILL_GENERATE_FORM_LABELS, DEFAULT_SKILL_GLOBAL_BADGE_LABELS, DEFAULT_SKILL_ROW_LABELS, DEFAULT_SKILL_VIEW_TOGGLE_LABELS, DEFAULT_SUBAGENT_ROSTER_LABELS, DEFAULT_TASKS_CHROME_LABELS, DEFAULT_TASK_COMPOSER_LABELS, DEFAULT_TASK_LIST_LABELS, DEFAULT_TASK_OUTPUTS_CELL_LABELS, DEFAULT_TASK_PLAN_LABELS, DEFAULT_TASK_RUNS_DIALOG_LABELS, DEFAULT_TASK_STATUS_PILL_LABELS, DEFAULT_TASK_THREAD_CHIP_LABELS, DEFAULT_TASK_TRIGGER_CHIP_LABELS, DEFAULT_TUPLE_ARRAY_FIELD_LABELS, DEFAULT_UPLOAD_TASK_ITEM_LABELS, DEFAULT_UPLOAD_TASK_LIST_LABELS, DEFAULT_WORKFLOWS_CHROME_LABELS, DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, DEFAULT_WORKFLOW_LIST_LABELS, DEFAULT_WORKFLOW_THREAD_STRIP_LABELS, DERIVED_NAME_WORDS, EMPTY_NEW_THREAD, EntityChip, GoalCriteria, MAX_TASK_DEPTH, NewThreadDialog, PersonPill, PillSelect, RecurrenceBuilder, STATUS_LABELS, STATUS_ORDER, STATUS_TONE, SkillActionButton, SkillCard, SkillDetail, SkillDetailSection, SkillEditForm, SkillFilterChips, SkillGenerateForm, SkillGlobalBadge, SkillRow, SkillTile, SkillTypeBadge, SkillViewToggle, StepDetail, StepNarration, StepOutcome, StepParams, StepRow, StepSummary, StepTrace, StepTraceSummary, SubAgentLane, SubStepGroup, SubagentRoster, TASK_COLUMN_ORDER, TRIGGER_LABELS, TaskActivityDialog, TaskComposer, TaskFlow, TaskInbox, TaskMoveDialog, TaskOutputsCell, TaskPlan, TaskRunsDialog, TaskStartDialog, TaskStatusPill, TaskTable, TaskThreadChip, TaskTriggerChip, TasksToolbar, ThreadActivity, ThreadNotifyDialog, TupleArrayField, UploadTaskItem, UploadTaskList, WEEKDAYS, WORKFLOW_COLUMN_ORDER, WorkflowConfigDialog, WorkflowDocumentsField, WorkflowLauncher, WorkflowThreadStartedBy, WorkflowThreadStrip, WorkflowsTable, WorkflowsToolbar, agentConfigSectionToValues, agentCreatorToConfigSection, asTaskStatus, authModeFor, buildRRule, buildTaskRows, buildWorkflowScopeSource, compactThreadActivity, composePersona, composerToTaskQuery, composerToWorkRequest, composerToWorkflowRequest, composerToWorkflowUpdate, createTaskColumns, createWorkflowColumns, createsWork, defaultScopeRenderer, defaultTaskComposerValues, deriveAgentName, deriveWorkflowName, descendantIds, describeRRule, filterConversationRows, firstWords, formatElapsed, goalProgress, groupThreadActivity, hasTaskFields, hasTrigger, humanizeSection, indexTasks, inferType, inputDocumentIds, isAgenticWorkflow, isOutOfBounds, isPlainTodo, isSkillRow, isValidAgentName, isoToLocalInput, linkedRunsFromActivity, localInputToIso, matchWorkflowScope, moveTargets, newThreadToRequest, nextCriterionId, ownerExtId, parseRRule, prettifyKey, resolveScopeInputs, skillSlug, stripPersonaPreamble, summarizeAgent, summarizeCapabilities, taskComposerToCreateRequest, taskComposerToUpdateRequest, taskNeedsAccess, taskToComposerValues, useWorkflowPreview, workflowFromSkillMarkdown, workflowStatus, workflowTaskFields, workflowToComposerValues, workflowToSkillMarkdown, workflowTriggerType, workflowWhen } from './chunk-
|
|
24
|
+
export { AgentAvatarField, AgentBar, AgentBarIconButton, AgentBarMenu, AgentBarNotes, AgentBarProbeAnswer, AgentBarQueuedNote, AgentBarStatus, AgentCard, AgentCreateView, AgentCreatedView, AgentCreator, AgentEditView, AgentGallery, AgentMainView, AgentSelect, AgentTypeSelector, CapabilityGrid, CapabilityTile, ConfigField, ConfigForm, ConsentActions, ConsentBulletList, ConsentCard, ConsentFootnote, ConsentHeader, ConsentMessage, ConsentNotice, ConsentPage, ConsentPermissionList, ConsentSection, ConsentStrong, ConsentText, ConversationListView, ConversationTurnSpeaker, CopyableUrl, DEFAULT_AGENT_AVATAR_FIELD_LABELS, DEFAULT_AGENT_BAR_LABELS, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_CREATOR_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_AGENT_SELECT_LABELS, DEFAULT_AGENT_STEPS_LABELS, DEFAULT_AGENT_TYPE_SELECTOR_LABELS, DEFAULT_AUTHORIZE_AGENT_LABELS, DEFAULT_CONFIG_FIELD_LABELS, DEFAULT_CONFIG_FORM_LABELS, DEFAULT_CONSENT_ACTIONS_LABELS, DEFAULT_COPYABLE_URL_LABELS, DEFAULT_NEW_THREAD_DIALOG_LABELS, DEFAULT_PILL_SELECT_LABELS, DEFAULT_RECURRENCE, DEFAULT_RECURRENCE_BUILDER_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_EDIT_FORM_LABELS, DEFAULT_SKILL_GENERATE_FORM_LABELS, DEFAULT_SKILL_GLOBAL_BADGE_LABELS, DEFAULT_SKILL_ROW_LABELS, DEFAULT_SKILL_VIEW_TOGGLE_LABELS, DEFAULT_SUBAGENT_ROSTER_LABELS, DEFAULT_TASKS_CHROME_LABELS, DEFAULT_TASK_COMPOSER_LABELS, DEFAULT_TASK_LIST_LABELS, DEFAULT_TASK_OUTPUTS_CELL_LABELS, DEFAULT_TASK_PLAN_LABELS, DEFAULT_TASK_RUNS_DIALOG_LABELS, DEFAULT_TASK_STATUS_PILL_LABELS, DEFAULT_TASK_THREAD_CHIP_LABELS, DEFAULT_TASK_TRIGGER_CHIP_LABELS, DEFAULT_TUPLE_ARRAY_FIELD_LABELS, DEFAULT_UPLOAD_TASK_ITEM_LABELS, DEFAULT_UPLOAD_TASK_LIST_LABELS, DEFAULT_WORKFLOWS_CHROME_LABELS, DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, DEFAULT_WORKFLOW_LIST_LABELS, DEFAULT_WORKFLOW_THREAD_STRIP_LABELS, DERIVED_NAME_WORDS, EMPTY_NEW_THREAD, EntityChip, GoalCriteria, MAX_TASK_DEPTH, NewThreadDialog, PersonPill, PillSelect, RecurrenceBuilder, STATUS_LABELS, STATUS_ORDER, STATUS_TONE, SkillActionButton, SkillCard, SkillDetail, SkillDetailSection, SkillEditForm, SkillFilterChips, SkillGenerateForm, SkillGlobalBadge, SkillRow, SkillTile, SkillTypeBadge, SkillViewToggle, StepDetail, StepNarration, StepOutcome, StepParams, StepRow, StepSummary, StepTrace, StepTraceSummary, SubAgentLane, SubStepGroup, SubagentRoster, TASK_COLUMN_ORDER, TRIGGER_LABELS, TaskActivityDialog, TaskComposer, TaskFlow, TaskInbox, TaskMoveDialog, TaskOutputsCell, TaskPlan, TaskRunsDialog, TaskStartDialog, TaskStatusPill, TaskTable, TaskThreadChip, TaskTriggerChip, TasksToolbar, ThreadActivity, ThreadNotifyDialog, TupleArrayField, UploadTaskItem, UploadTaskList, WEEKDAYS, WORKFLOW_COLUMN_ORDER, WorkflowConfigDialog, WorkflowDocumentsField, WorkflowLauncher, WorkflowThreadStartedBy, WorkflowThreadStrip, WorkflowsTable, WorkflowsToolbar, agentConfigSectionToValues, agentCreatorToConfigSection, asTaskStatus, authModeFor, buildRRule, buildTaskRows, buildWorkflowScopeSource, compactThreadActivity, composePersona, composerToTaskQuery, composerToWorkRequest, composerToWorkflowRequest, composerToWorkflowUpdate, createTaskColumns, createWorkflowColumns, createsWork, defaultScopeRenderer, defaultTaskComposerValues, deriveAgentName, deriveWorkflowName, descendantIds, describeRRule, filterConversationRows, firstWords, formatElapsed, goalProgress, groupThreadActivity, hasTaskFields, hasTrigger, humanizeSection, indexTasks, inferType, inputDocumentIds, isAgenticWorkflow, isOutOfBounds, isPlainTodo, isSkillRow, isValidAgentName, isoToLocalInput, linkedRunsFromActivity, localInputToIso, matchWorkflowScope, moveTargets, newThreadToRequest, nextCriterionId, ownerExtId, parseRRule, prettifyKey, resolveScopeInputs, skillSlug, stripPersonaPreamble, summarizeAgent, summarizeCapabilities, taskComposerToCreateRequest, taskComposerToUpdateRequest, taskNeedsAccess, taskToComposerValues, useWorkflowPreview, workflowFromSkillMarkdown, workflowStatus, workflowTaskFields, workflowToComposerValues, workflowToSkillMarkdown, workflowTriggerType, workflowWhen } from './chunk-ZP4IFW2E.js';
|
|
25
25
|
import './chunk-P5ST47VY.js';
|
|
26
26
|
import './chunk-4XJZ6AAY.js';
|
|
27
27
|
export { EmptyState } from './chunk-P6GHJSLR.js';
|
|
@@ -38,8 +38,6 @@ export { DEFAULT_FILTER_FIELDS, DEFAULT_FILTER_INPUT_LABELS, FilterInput } from
|
|
|
38
38
|
import './chunk-N5YEF3LC.js';
|
|
39
39
|
export { AccountRecoveryDialog, AuthAlert, AuthConsent, AuthDivider, AuthField, AuthFieldBadge, AuthFooterLinks, AuthHeading, AuthHero, AuthInput, AuthLayout, AuthLink, AuthNote, AuthOfflineBadge, AuthSubmitButton, AuthTabs, DEFAULT_ACCOUNT_RECOVERY_DIALOG_LABELS, DEFAULT_AUTH_CONSENT_LABELS, DEFAULT_AUTH_FOOTER_LINKS_LABELS, DEFAULT_AUTH_OFFLINE_BADGE_LABELS, DEFAULT_RECOVERY_KEY_DIALOG_LABELS, DEFAULT_REVEALABLE_PASSWORD_INPUT_LABELS, DEFAULT_SSO_LOGIN_BUTTON_LABELS, RecoveryKeyDialog, RevealablePasswordInput, SsoLoginButton } from './chunk-SFXVNFES.js';
|
|
40
40
|
export { DEFAULT_PASSWORD_STRENGTH_INPUT_LABELS, PasswordStrengthInput } from './chunk-VILAPTCB.js';
|
|
41
|
-
export { DEFAULT_TAB_HEADER_LABELS, TabHeader } from './chunk-4WWM3GQ5.js';
|
|
42
|
-
import './chunk-TX2ZICS7.js';
|
|
43
41
|
export { AssistantToaster, BranchControls, ComposerAccessories, ComposerTools, ContextActionButton, ContextCheckRow, ContextPanelContent, ContextPanelFooter, ContextPanelTabs, ContextPickerList, ContextPickerRow, ContextSearchInput, ContextSelectList, ContextSelectRow, Conversation, ConversationBody, ConversationFilter, ConversationHeader, ConversationHeaderActions, ConversationHistoryPane, ConversationLoading, ConversationMain, ConversationRoot, ConversationSearchView, ConversationSettingsButton, DEFAULT_BRANCH_CONTROLS_LABELS, DEFAULT_CONVERSATION_LAYOUT_LABELS, DEFAULT_CONVERSATION_PARTS_LABELS, DEFAULT_CONVERSATION_SEARCH_LABELS, DEFAULT_LABEL_PIN_ROW_LABELS, DEFAULT_MODEL_PRICING_TIP_LABELS, DEFAULT_PENDING_ANSWER_BAR_LABELS, DEFAULT_PINNED_DOC_CHIP_LABELS, DEFAULT_SLASH_MENU_LABELS, DEFAULT_THREAD_MAP_LABELS, LabelPinRow, ModelAutoIcon, ModelConfigureButton, ModelDot, ModelMenuDivider, ModelMenuMessage, ModelOption, ModelOptionLabel, ModelPickerPopover, ModelPickerTrigger, ModelPricingTip, ModelTierIcon, ModelTierOption, ModelTriggerContent, NewChatButton, NewPaChatButton, PaModeBadge, PendingAnswerBar, PinnedDocChip, ProvisionalTranscriptLine, SlashMenu, ThreadMap, ThreadMapDiagram, ThreadMapError, ThreadMapLoading, TranscriptLine, getParticipantTints, hasMessageBody, isLongPastedText, transcriptRuns, useDismissibleCard, useLongPaste, useRecipientDraft } from './chunk-2FUJXMGO.js';
|
|
44
42
|
export { DEFAULT_DOCK_WIDTH, Toaster } from './chunk-OKERRHLH.js';
|
|
45
43
|
export { AssistantDock, AssistantDockToggle, AssistantModeToggle, ChatDocuments, ChatMessageContent, ChatPage, ChatThreadList, ChatThreadSelect, CitationMark, Composer, ComposerBranchingNotice, ComposerContainer, ComposerDock, ComposerFrame, ComposerInput, ComposerRoot, ComposerSend, ComposerToolbar, ComposerVoiceButton, ContextChip, ConversationEmpty, DEFAULT_ASSISTANT_MODE_TOGGLE_LABELS, DEFAULT_CHAT_PAGE_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_CONVERSATION_EMPTY_LABELS, DEFAULT_MESSAGE_ALERT_LABELS, DEFAULT_MESSAGE_LABELS, DEFAULT_MESSAGE_LIST_LABELS, DEFAULT_WORKFLOW_STEP_CHIP_LABELS, Message, MessageActionButton, MessageActionMenu, MessageAlert, MessageAuthor, MessageBody, MessageBubble, MessageByline, MessageContent, MessageFooter, MessageList, MessageListBanner, MessageListEmpty, MessageListRoot, MessageListRow, MessageListRows, MessageListStatus, MessageListTail, MessageNarration, MessageRoot, MessageSources, MessageSubagentBadge, ScrollToBottom, SourceChip, WorkflowStepChip, toSpeakableText, useAssistantDock, useChatSurface, useRegisterEmbeddedChat, useStreamAnnouncement } from './chunk-TCNYKDYE.js';
|
|
@@ -47,6 +45,8 @@ export { BlocksTooltipProvider, DEFAULT_OVERLAY_ZONE_ID, DEFAULT_PAGE_CONTAINER_
|
|
|
47
45
|
export { useMentionAutocomplete } from './chunk-HOXKR26S.js';
|
|
48
46
|
export { DEFAULT_MENTION_LABELS, MENTION_HREF_PREFIX, MentionChip, MentionMenu, extractMentions, filterMentionCandidates, findMentionQuery, insertMention, linkMentions, mentionFromHref, toMessageMentions, useListKeyNav } from './chunk-AA3PT6KR.js';
|
|
49
47
|
export { BREAKPOINT_QUERIES, useIsNarrow, useIsPhone, useIsTouchScreen, useMediaQuery } from './chunk-SLSBJRWW.js';
|
|
48
|
+
export { DEFAULT_TAB_HEADER_LABELS, TabHeader } from './chunk-4WWM3GQ5.js';
|
|
49
|
+
import './chunk-TX2ZICS7.js';
|
|
50
50
|
import './chunk-Z3AZ7Q5X.js';
|
|
51
51
|
import './chunk-NPLYHR2E.js';
|
|
52
52
|
import './chunk-7F6CBP3Z.js';
|
package/dist/shell/index.cjs
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
var chunkS6BOINC4_cjs = require('../chunk-S6BOINC4.cjs');
|
|
5
5
|
require('../chunk-OB5F4577.cjs');
|
|
6
6
|
var chunk2EI7NCUA_cjs = require('../chunk-2EI7NCUA.cjs');
|
|
7
|
-
var chunk7RGLTF76_cjs = require('../chunk-7RGLTF76.cjs');
|
|
8
7
|
var chunk5UHAWSEX_cjs = require('../chunk-5UHAWSEX.cjs');
|
|
9
8
|
var chunkB6MVQCXW_cjs = require('../chunk-B6MVQCXW.cjs');
|
|
10
9
|
var chunkFX3K6LNZ_cjs = require('../chunk-FX3K6LNZ.cjs');
|
|
10
|
+
var chunk7RGLTF76_cjs = require('../chunk-7RGLTF76.cjs');
|
|
11
11
|
require('../chunk-PPCATBOY.cjs');
|
|
12
12
|
require('../chunk-MHVNT4J3.cjs');
|
|
13
13
|
require('../chunk-C54XEN5T.cjs');
|
|
@@ -203,14 +203,6 @@ Object.defineProperty(exports, "FilterInput", {
|
|
|
203
203
|
enumerable: true,
|
|
204
204
|
get: function () { return chunk2EI7NCUA_cjs.FilterInput; }
|
|
205
205
|
});
|
|
206
|
-
Object.defineProperty(exports, "DEFAULT_TAB_HEADER_LABELS", {
|
|
207
|
-
enumerable: true,
|
|
208
|
-
get: function () { return chunk7RGLTF76_cjs.DEFAULT_TAB_HEADER_LABELS; }
|
|
209
|
-
});
|
|
210
|
-
Object.defineProperty(exports, "TabHeader", {
|
|
211
|
-
enumerable: true,
|
|
212
|
-
get: function () { return chunk7RGLTF76_cjs.TabHeader; }
|
|
213
|
-
});
|
|
214
206
|
Object.defineProperty(exports, "DEFAULT_DOCK_WIDTH", {
|
|
215
207
|
enumerable: true,
|
|
216
208
|
get: function () { return chunk5UHAWSEX_cjs.DEFAULT_DOCK_WIDTH; }
|
|
@@ -283,5 +275,13 @@ Object.defineProperty(exports, "useMediaQuery", {
|
|
|
283
275
|
enumerable: true,
|
|
284
276
|
get: function () { return chunkFX3K6LNZ_cjs.useMediaQuery; }
|
|
285
277
|
});
|
|
278
|
+
Object.defineProperty(exports, "DEFAULT_TAB_HEADER_LABELS", {
|
|
279
|
+
enumerable: true,
|
|
280
|
+
get: function () { return chunk7RGLTF76_cjs.DEFAULT_TAB_HEADER_LABELS; }
|
|
281
|
+
});
|
|
282
|
+
Object.defineProperty(exports, "TabHeader", {
|
|
283
|
+
enumerable: true,
|
|
284
|
+
get: function () { return chunk7RGLTF76_cjs.TabHeader; }
|
|
285
|
+
});
|
|
286
286
|
//# sourceMappingURL=index.cjs.map
|
|
287
287
|
//# sourceMappingURL=index.cjs.map
|
package/dist/shell/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
export { ActionCluster, AskField, AskRow, AskTrigger, DEFAULT_ASK_FIELD_LABELS, DEFAULT_INSTALL_PROMPT_LABELS, DEFAULT_MOBILE_BARS_LABELS, DEFAULT_OFFLINE_PILL_LABELS, DEFAULT_REMOTE_CONTROL_PILL_LABELS, DEFAULT_SIDEBAR_LABELS, DEFAULT_TIP_CARD_LABELS, DEFAULT_WORKSPACE_KIND_LABELS, DEFAULT_WORKSPACE_SWITCHER_LABELS, INSTALL_PROMPT_DISMISSED_KEY, InfoBar, InstallPrompt, MobileAppBar, MobileTabBar, NotificationBell, OfflinePill, RemoteControlPill, STATUS_ROW_BASE_CLASS, STATUS_ROW_TONES, Sidebar, SidebarBadgeRow, SidebarRowAction, SidebarRowHoverContext, SplitLayout, StatusBadge, StatusRow, TipCard, UserMenu, WorkspaceIdentity, WorkspaceSwitcher, getInstallInstructions, initInstallPrompt, isIosDevice, promptAppInstall, resolveSidebarLayout, useInstallPrompt, useSidebarContext, useSidebarSettle, workspaceKindColor, workspaceKindMeta } from '../chunk-D3N67Q4D.js';
|
|
3
3
|
import '../chunk-S7PSMMRG.js';
|
|
4
4
|
export { DEFAULT_FILTER_FIELDS, DEFAULT_FILTER_INPUT_LABELS, FilterInput } from '../chunk-YU2KUMGE.js';
|
|
5
|
-
export { DEFAULT_TAB_HEADER_LABELS, TabHeader } from '../chunk-4WWM3GQ5.js';
|
|
6
5
|
export { DEFAULT_DOCK_WIDTH, Toaster } from '../chunk-OKERRHLH.js';
|
|
7
6
|
export { DEFAULT_OVERLAY_ZONE_ID, DEFAULT_PAGE_CONTAINER_PADDING, DEFAULT_SIDEBAR_TOGGLE_BUTTON_LABELS, PageContainer, SHELL_BOTTOM_INSET_VAR, Shell, SidebarToggleButton, ToolButton, useDrawerBehavior, useOverlayZoneId, useShellBottomInset } from '../chunk-7XF5SFJ2.js';
|
|
8
7
|
export { BREAKPOINT_QUERIES, useIsNarrow, useIsPhone, useIsTouchScreen, useMediaQuery } from '../chunk-SLSBJRWW.js';
|
|
8
|
+
export { DEFAULT_TAB_HEADER_LABELS, TabHeader } from '../chunk-4WWM3GQ5.js';
|
|
9
9
|
import '../chunk-NPLYHR2E.js';
|
|
10
10
|
import '../chunk-7F6CBP3Z.js';
|
|
11
11
|
import '../chunk-76JDDMSP.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkMUMH3Z6K_cjs = require('../chunk-MUMH3Z6K.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkZ2NSU7D5_cjs = require('../chunk-Z2NSU7D5.cjs');
|
|
6
6
|
require('../chunk-ZV3BKLFY.cjs');
|
|
7
7
|
require('../chunk-S5HZBXZA.cjs');
|
|
8
8
|
require('../chunk-ZW6FPIFC.cjs');
|
|
@@ -17,11 +17,11 @@ var chunk32HW2Q33_cjs = require('../chunk-32HW2Q33.cjs');
|
|
|
17
17
|
require('../chunk-V4ISCZJ7.cjs');
|
|
18
18
|
require('../chunk-2EI7NCUA.cjs');
|
|
19
19
|
require('../chunk-C2CWWEHO.cjs');
|
|
20
|
-
require('../chunk-7RGLTF76.cjs');
|
|
21
|
-
require('../chunk-ULWRNGGE.cjs');
|
|
22
20
|
require('../chunk-B4SRYJLM.cjs');
|
|
23
21
|
require('../chunk-7UTB4PHM.cjs');
|
|
24
22
|
require('../chunk-FX3K6LNZ.cjs');
|
|
23
|
+
require('../chunk-7RGLTF76.cjs');
|
|
24
|
+
require('../chunk-ULWRNGGE.cjs');
|
|
25
25
|
require('../chunk-PPCATBOY.cjs');
|
|
26
26
|
require('../chunk-MHVNT4J3.cjs');
|
|
27
27
|
require('../chunk-C54XEN5T.cjs');
|
|
@@ -1615,7 +1615,7 @@ function triggerFields(trigger, clearOthers) {
|
|
|
1615
1615
|
return {
|
|
1616
1616
|
timezone: trigger.timezone,
|
|
1617
1617
|
rrule: trigger.start === "repeat" ? trigger.rrule.trim() : none,
|
|
1618
|
-
run_at: trigger.start === "once" ?
|
|
1618
|
+
run_at: trigger.start === "once" ? chunkZ2NSU7D5_cjs.localInputToIso(trigger.runAt) : none,
|
|
1619
1619
|
event_kind: trigger.start === "event" ? trigger.eventKind.trim() : none,
|
|
1620
1620
|
// A step signal is `workflow_signal` narrowed to one signal name.
|
|
1621
1621
|
event_filter: filter ?? none,
|
|
@@ -1674,7 +1674,7 @@ function workflowRecordToBuilder(record) {
|
|
|
1674
1674
|
...record.skill_ref ? { workflow: record.skill_ref } : { run: { kind: "prompt", promptTemplate: record.prompt } }
|
|
1675
1675
|
}
|
|
1676
1676
|
] : [];
|
|
1677
|
-
const when =
|
|
1677
|
+
const when = chunkZ2NSU7D5_cjs.workflowWhen(record);
|
|
1678
1678
|
return {
|
|
1679
1679
|
workflow: {
|
|
1680
1680
|
id: record.external_id,
|
|
@@ -1688,7 +1688,7 @@ function workflowRecordToBuilder(record) {
|
|
|
1688
1688
|
trigger: {
|
|
1689
1689
|
...DEFAULT_WORKFLOW_TRIGGER,
|
|
1690
1690
|
start: when === "now" ? "manual" : when,
|
|
1691
|
-
runAt:
|
|
1691
|
+
runAt: chunkZ2NSU7D5_cjs.isoToLocalInput(record.run_at),
|
|
1692
1692
|
rrule: record.rrule ?? "",
|
|
1693
1693
|
timezone: record.timezone || DEFAULT_WORKFLOW_TRIGGER.timezone,
|
|
1694
1694
|
eventKind: record.event_kind ?? "",
|
|
@@ -1744,7 +1744,7 @@ function triggerSummary(trigger, options = {}) {
|
|
|
1744
1744
|
case "once":
|
|
1745
1745
|
return trigger.runAt ? new Date(trigger.runAt).toLocaleString() : l.starts.once;
|
|
1746
1746
|
case "repeat":
|
|
1747
|
-
return trigger.rrule ?
|
|
1747
|
+
return trigger.rrule ? chunkZ2NSU7D5_cjs.describeRRule(trigger.rrule) : l.starts.repeat;
|
|
1748
1748
|
case "event":
|
|
1749
1749
|
if (isSignalTrigger(trigger))
|
|
1750
1750
|
return trigger.signal ? l.signalSummary.replace("{signal}", trigger.signal) : l.stepSignals;
|
|
@@ -1803,7 +1803,7 @@ function TriggerInspector({
|
|
|
1803
1803
|
}
|
|
1804
1804
|
)
|
|
1805
1805
|
] }),
|
|
1806
|
-
trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1806
|
+
trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(chunkZ2NSU7D5_cjs.RecurrenceBuilder, { rrule: trigger.rrule, onChange: (rrule) => set({ rrule }) }),
|
|
1807
1807
|
trigger.start === "event" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1808
1808
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.event }),
|
|
1809
1809
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1855,7 +1855,7 @@ function TriggerInspector({
|
|
|
1855
1855
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1856
1856
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.agent }),
|
|
1857
1857
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1858
|
-
|
|
1858
|
+
chunkZ2NSU7D5_cjs.AgentSelect,
|
|
1859
1859
|
{
|
|
1860
1860
|
agents,
|
|
1861
1861
|
value: trigger.agentId,
|
|
@@ -2706,7 +2706,7 @@ function WorkflowPreview({
|
|
|
2706
2706
|
renderIcon,
|
|
2707
2707
|
testId
|
|
2708
2708
|
}) {
|
|
2709
|
-
const run =
|
|
2709
|
+
const run = chunkZ2NSU7D5_cjs.useWorkflowPreview(workflow, {
|
|
2710
2710
|
resolveWorkflow: (id) => workflows.find((w) => w.id === id),
|
|
2711
2711
|
compose,
|
|
2712
2712
|
answer
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useConnection } from '../chunk-OYMWV45N.js';
|
|
3
|
-
import { workflowWhen, isoToLocalInput, describeRRule, RecurrenceBuilder, AgentSelect, useWorkflowPreview, localInputToIso } from '../chunk-
|
|
3
|
+
import { workflowWhen, isoToLocalInput, describeRRule, RecurrenceBuilder, AgentSelect, useWorkflowPreview, localInputToIso } from '../chunk-ZP4IFW2E.js';
|
|
4
4
|
import '../chunk-P5ST47VY.js';
|
|
5
5
|
import '../chunk-4XJZ6AAY.js';
|
|
6
6
|
import '../chunk-P6GHJSLR.js';
|
|
@@ -15,11 +15,11 @@ import { TONE_DOT, TONES, isTone } from '../chunk-AUS3KBHJ.js';
|
|
|
15
15
|
import '../chunk-NUNKSZKU.js';
|
|
16
16
|
import '../chunk-YU2KUMGE.js';
|
|
17
17
|
import '../chunk-N5YEF3LC.js';
|
|
18
|
-
import '../chunk-4WWM3GQ5.js';
|
|
19
|
-
import '../chunk-TX2ZICS7.js';
|
|
20
18
|
import '../chunk-HOXKR26S.js';
|
|
21
19
|
import '../chunk-AA3PT6KR.js';
|
|
22
20
|
import '../chunk-SLSBJRWW.js';
|
|
21
|
+
import '../chunk-4WWM3GQ5.js';
|
|
22
|
+
import '../chunk-TX2ZICS7.js';
|
|
23
23
|
import '../chunk-NPLYHR2E.js';
|
|
24
24
|
import '../chunk-7F6CBP3Z.js';
|
|
25
25
|
import '../chunk-76JDDMSP.js';
|
|
@@ -10,6 +10,14 @@ var fflate = require('fflate');
|
|
|
10
10
|
var DEFINED_TERM_STYLE = "DefinedTerm";
|
|
11
11
|
var CROSS_REFERENCE_STYLE = "CrossReference";
|
|
12
12
|
var BROKEN_CROSS_REFERENCE_STYLE = "CrossReferenceBroken";
|
|
13
|
+
function engineOffset(paragraph, offset, pastDeletions = false) {
|
|
14
|
+
let out = offset;
|
|
15
|
+
for (const r of paragraph.revisions ?? [])
|
|
16
|
+
if (r.kind === "delete" && (r.offset < offset || pastDeletions && r.offset === offset))
|
|
17
|
+
out += r.length;
|
|
18
|
+
return out;
|
|
19
|
+
}
|
|
20
|
+
var engineLength = (paragraph) => engineOffset(paragraph, paragraph.text.length, true);
|
|
13
21
|
var WATCHED_STYLES = /* @__PURE__ */ new Set([BROKEN_CROSS_REFERENCE_STYLE]);
|
|
14
22
|
var attr = (node, name) => node.attributes?.find((a) => a.localName === name)?.value;
|
|
15
23
|
var FIELD_ATOM = "\uFFFC";
|
|
@@ -44,6 +52,7 @@ function readParagraph(node, topLevel, bookmarks) {
|
|
|
44
52
|
let runStyle;
|
|
45
53
|
const fields = [];
|
|
46
54
|
const notes = [];
|
|
55
|
+
const revisions = [];
|
|
47
56
|
let current = null;
|
|
48
57
|
const field = (c) => {
|
|
49
58
|
const type = attr(c, "fldCharType");
|
|
@@ -85,7 +94,31 @@ function readParagraph(node, topLevel, bookmarks) {
|
|
|
85
94
|
}
|
|
86
95
|
continue;
|
|
87
96
|
}
|
|
88
|
-
if (c.localName === "
|
|
97
|
+
if (c.localName === "del") {
|
|
98
|
+
const deleted = deletedText(c);
|
|
99
|
+
if (deleted && fieldDepth === 0)
|
|
100
|
+
revisions.push({
|
|
101
|
+
kind: "delete",
|
|
102
|
+
offset: text.length,
|
|
103
|
+
length: deleted.length,
|
|
104
|
+
author: attr(c, "author"),
|
|
105
|
+
text: deleted
|
|
106
|
+
});
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (c.localName === "ins") {
|
|
110
|
+
const start = text.length;
|
|
111
|
+
walk(c, link);
|
|
112
|
+
if (text.length > start && fieldDepth === 0)
|
|
113
|
+
revisions.push({
|
|
114
|
+
kind: "insert",
|
|
115
|
+
offset: start,
|
|
116
|
+
length: text.length - start,
|
|
117
|
+
author: attr(c, "author")
|
|
118
|
+
});
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
if (c.localName === "delText" || c.localName === "rPr") continue;
|
|
89
122
|
if (c.localName === "r") {
|
|
90
123
|
const rStyle = c.children?.find((x) => x.localName === "rPr")?.children?.find((x) => x.localName === "rStyle");
|
|
91
124
|
const watched = rStyle && attr(rStyle, "val");
|
|
@@ -148,9 +181,20 @@ function readParagraph(node, topLevel, bookmarks) {
|
|
|
148
181
|
links,
|
|
149
182
|
...fields.length ? { fields } : {},
|
|
150
183
|
...marks.length ? { marks } : {},
|
|
151
|
-
...notes.length ? { notes } : {}
|
|
184
|
+
...notes.length ? { notes } : {},
|
|
185
|
+
...revisions.length ? { revisions } : {}
|
|
152
186
|
};
|
|
153
187
|
}
|
|
188
|
+
function deletedText(node) {
|
|
189
|
+
let out = "";
|
|
190
|
+
for (const c of node.children ?? []) {
|
|
191
|
+
if (c.localName === "instrText") continue;
|
|
192
|
+
if (c.localName === "delText") out += (c.children ?? []).map((t) => t.value ?? "").join("");
|
|
193
|
+
else if (c.localName === "tab") out += " ";
|
|
194
|
+
else if (c.localName !== "rPr") out += deletedText(c);
|
|
195
|
+
}
|
|
196
|
+
return out;
|
|
197
|
+
}
|
|
154
198
|
function styleNames(root) {
|
|
155
199
|
const names = /* @__PURE__ */ new Map();
|
|
156
200
|
for (const style of root?.children ?? []) {
|
|
@@ -1041,7 +1085,7 @@ function insertParagraphs(port, index, body, count, keep) {
|
|
|
1041
1085
|
port.setCaret({ paragraphId: before[index].id, offset: 0 });
|
|
1042
1086
|
} else {
|
|
1043
1087
|
const last = before[before.length - 1];
|
|
1044
|
-
port.setCaret({ paragraphId: last.id, offset: last
|
|
1088
|
+
port.setCaret({ paragraphId: last.id, offset: engineLength(last) });
|
|
1045
1089
|
port.splitParagraph();
|
|
1046
1090
|
const opened = port.paragraphs();
|
|
1047
1091
|
port.setCaret({ paragraphId: opened[opened.length - 1].id, offset: 0 });
|
|
@@ -1073,25 +1117,47 @@ function addDefinition(port, definition, keep) {
|
|
|
1073
1117
|
);
|
|
1074
1118
|
}
|
|
1075
1119
|
var hasBookmark = (paragraphs, name) => paragraphs.some((p) => p.bookmarks.includes(name));
|
|
1120
|
+
var paragraphOf = (port, id) => port.paragraphs().find((p) => p.id === id);
|
|
1121
|
+
function replaceSpan(port, span, insert, length) {
|
|
1122
|
+
const { paragraphId, from, to } = span;
|
|
1123
|
+
if (from > to) throw new Error("A replacement runs forwards.");
|
|
1124
|
+
const before = paragraphOf(port, paragraphId);
|
|
1125
|
+
if (!before) throw new Error("That paragraph is no longer in the document.");
|
|
1126
|
+
const length0 = engineLength(before);
|
|
1127
|
+
port.setCaret({ paragraphId, offset: to });
|
|
1128
|
+
if (!insert()) return false;
|
|
1129
|
+
if (from < to) {
|
|
1130
|
+
try {
|
|
1131
|
+
port.deleteRange({ paragraphId, offset: from }, { paragraphId, offset: to });
|
|
1132
|
+
} catch (error) {
|
|
1133
|
+
port.deleteRange({ paragraphId, offset: to }, { paragraphId, offset: to + length });
|
|
1134
|
+
throw error;
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
const after = paragraphOf(port, paragraphId);
|
|
1138
|
+
const kept = after && engineLength(after) - length0 === length;
|
|
1139
|
+
port.setCaret({ paragraphId, offset: (kept ? to : from) + length });
|
|
1140
|
+
return true;
|
|
1141
|
+
}
|
|
1076
1142
|
function insertDefinedTerm(port, definition, options = {}) {
|
|
1077
1143
|
const start = port.caret();
|
|
1078
1144
|
if (!start) throw new Error("Place the cursor where the term should go.");
|
|
1079
|
-
let caret = start;
|
|
1080
|
-
if (options.replace) {
|
|
1081
|
-
caret = { paragraphId: start.paragraphId, offset: Math.max(0, start.offset - options.replace) };
|
|
1082
|
-
port.deleteRange(caret, start);
|
|
1083
|
-
}
|
|
1084
1145
|
const bookmark = definitionBookmark(definition.id);
|
|
1085
1146
|
const addedDefinition = !hasBookmark(port.paragraphs(), bookmark);
|
|
1086
|
-
|
|
1087
|
-
port.
|
|
1088
|
-
if (!port.paste(
|
|
1147
|
+
const caret = addedDefinition && addDefinition(port, definition, start) || start;
|
|
1148
|
+
const insert = () => port.paste(
|
|
1089
1149
|
termLinkXml(definition.term, bookmark, definitionTooltip(definition)),
|
|
1090
1150
|
definition.term,
|
|
1091
1151
|
false
|
|
1152
|
+
);
|
|
1153
|
+
const from = Math.max(0, caret.offset - (options.replace ?? 0));
|
|
1154
|
+
if (!replaceSpan(
|
|
1155
|
+
port,
|
|
1156
|
+
{ paragraphId: caret.paragraphId, from, to: caret.offset },
|
|
1157
|
+
insert,
|
|
1158
|
+
definition.term.length
|
|
1092
1159
|
))
|
|
1093
1160
|
throw new Error("The term could not be inserted.");
|
|
1094
|
-
port.setCaret({ paragraphId: caret.paragraphId, offset: caret.offset + definition.term.length });
|
|
1095
1161
|
return { addedDefinition };
|
|
1096
1162
|
}
|
|
1097
1163
|
function definitionsById(definitions) {
|
|
@@ -1102,6 +1168,144 @@ function definitionOfAnchor(anchor, definitions) {
|
|
|
1102
1168
|
return id ? definitions.get(id) : void 0;
|
|
1103
1169
|
}
|
|
1104
1170
|
|
|
1171
|
+
// src/commands/everywhere.ts
|
|
1172
|
+
var WORD = "[\\p{L}\\p{N}_\\-\u2010\u2011]";
|
|
1173
|
+
var escape = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1174
|
+
function needlesOf(spec) {
|
|
1175
|
+
const term = spec.term.replace(/\s+/g, " ").trim();
|
|
1176
|
+
const variants = [
|
|
1177
|
+
...new Set((spec.variants ?? []).map((v) => v.replace(/\s+/g, " ").trim()))
|
|
1178
|
+
].filter((v) => v && v !== term);
|
|
1179
|
+
const needles = [
|
|
1180
|
+
...variants.map((text) => ({ text, kind: "variant" })),
|
|
1181
|
+
...spec.link ? [{ text: term, kind: "term" }] : []
|
|
1182
|
+
];
|
|
1183
|
+
return needles.map((n) => ({
|
|
1184
|
+
...n,
|
|
1185
|
+
pattern: new RegExp(
|
|
1186
|
+
`(?<!${WORD})${n.text.split(" ").map(escape).join("\\s+")}(?!${WORD})`,
|
|
1187
|
+
"gu"
|
|
1188
|
+
)
|
|
1189
|
+
}));
|
|
1190
|
+
}
|
|
1191
|
+
function matchesIn(text, needles) {
|
|
1192
|
+
const found = [];
|
|
1193
|
+
for (const needle of needles)
|
|
1194
|
+
for (const m of text.matchAll(needle.pattern))
|
|
1195
|
+
found.push({ offset: m.index ?? 0, text: m[0], kind: needle.kind });
|
|
1196
|
+
found.sort((a, b) => a.offset - b.offset || b.text.length - a.text.length);
|
|
1197
|
+
const out = [];
|
|
1198
|
+
for (const m of found)
|
|
1199
|
+
if (!out.length || m.offset >= out[out.length - 1].offset + out[out.length - 1].text.length)
|
|
1200
|
+
out.push(m);
|
|
1201
|
+
return out;
|
|
1202
|
+
}
|
|
1203
|
+
var overlaps = (start, end, from, to) => start < to && from < end;
|
|
1204
|
+
function findTermUses(paragraphs, spec, bookmark) {
|
|
1205
|
+
const needles = needlesOf(spec);
|
|
1206
|
+
const defining = new Set([spec.term, ...spec.variants ?? []].map(termKey));
|
|
1207
|
+
const uses = [];
|
|
1208
|
+
const skipped = [];
|
|
1209
|
+
for (const p of paragraphs) {
|
|
1210
|
+
const at = { paragraphId: p.id, ...p.paraId ? { paraId: p.paraId } : {} };
|
|
1211
|
+
const defined = parseDefinition(p.text.split(FIELD_ATOM).join(""));
|
|
1212
|
+
const isDefinition = defined !== null && defining.has(termKey(defined.term));
|
|
1213
|
+
for (const m of matchesIn(p.text, needles)) {
|
|
1214
|
+
const use = { ...at, ...m };
|
|
1215
|
+
const end = m.offset + m.text.length;
|
|
1216
|
+
const link = p.links.find(
|
|
1217
|
+
(l) => l.offset !== void 0 && overlaps(m.offset, end, l.offset, l.offset + l.text.length)
|
|
1218
|
+
);
|
|
1219
|
+
const pending = (p.revisions ?? []).some(
|
|
1220
|
+
(r) => r.kind === "insert" ? overlaps(m.offset, end, r.offset, r.offset + r.length) : r.offset > m.offset && r.offset < end
|
|
1221
|
+
);
|
|
1222
|
+
const reason = isDefinition ? "definition" : link ? link.anchor === bookmark ? "linked" : "link" : pending ? "pending-change" : null;
|
|
1223
|
+
if (reason) skipped.push({ ...use, reason });
|
|
1224
|
+
else uses.push(use);
|
|
1225
|
+
}
|
|
1226
|
+
for (const field of p.fields ?? [])
|
|
1227
|
+
for (const m of matchesIn(field.result, needles))
|
|
1228
|
+
skipped.push({ ...at, offset: field.offset, text: m.text, kind: m.kind, reason: "field" });
|
|
1229
|
+
}
|
|
1230
|
+
return { uses, skipped };
|
|
1231
|
+
}
|
|
1232
|
+
function replacedText(text, uses, term) {
|
|
1233
|
+
let out = text;
|
|
1234
|
+
for (const use of [...uses].sort((a, b) => b.offset - a.offset))
|
|
1235
|
+
out = out.slice(0, use.offset) + term + out.slice(use.offset + use.text.length);
|
|
1236
|
+
return out;
|
|
1237
|
+
}
|
|
1238
|
+
var TermEverywhereError = class extends Error {
|
|
1239
|
+
constructor(message) {
|
|
1240
|
+
super(message);
|
|
1241
|
+
this.name = "TermEverywhereError";
|
|
1242
|
+
}
|
|
1243
|
+
};
|
|
1244
|
+
function applyTermEverywhere(port, spec, { accept } = {}) {
|
|
1245
|
+
const term = spec.term.replace(/\s+/g, " ").trim();
|
|
1246
|
+
if (!term) throw new Error("Name the defined term.");
|
|
1247
|
+
let addedDefinition = false;
|
|
1248
|
+
let link;
|
|
1249
|
+
if (spec.link) {
|
|
1250
|
+
if (!spec.definition) throw new Error(`Linking "${term}" needs its definition.`);
|
|
1251
|
+
link = {
|
|
1252
|
+
bookmark: definitionBookmark(spec.definition.id),
|
|
1253
|
+
tooltip: definitionTooltip(spec.definition)
|
|
1254
|
+
};
|
|
1255
|
+
if (!port.paragraphs().some((p) => p.bookmarks.includes(link.bookmark))) {
|
|
1256
|
+
addDefinition(port, spec.definition);
|
|
1257
|
+
addedDefinition = true;
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
const paragraphs = port.paragraphs();
|
|
1261
|
+
const { uses, skipped } = findTermUses(paragraphs, { ...spec, term }, link?.bookmark);
|
|
1262
|
+
const changed = [];
|
|
1263
|
+
const insert = link ? () => port.paste(termLinkXml(term, link.bookmark, link.tooltip), term, false) : () => {
|
|
1264
|
+
port.typeText(term);
|
|
1265
|
+
return true;
|
|
1266
|
+
};
|
|
1267
|
+
for (const p of paragraphs) {
|
|
1268
|
+
const mine = uses.filter((u) => u.paragraphId === p.id);
|
|
1269
|
+
if (!mine.length) continue;
|
|
1270
|
+
if (accept && !accept(p)) {
|
|
1271
|
+
skipped.push(...mine.map((u) => ({ ...u, reason: "unsupported-content" })));
|
|
1272
|
+
continue;
|
|
1273
|
+
}
|
|
1274
|
+
const current = () => port.paragraphs().find((x) => p.paraId ? x.paraId === p.paraId : x.id === p.id);
|
|
1275
|
+
const done = [];
|
|
1276
|
+
for (const use of [...mine].sort((a, b) => b.offset - a.offset)) {
|
|
1277
|
+
const now = current();
|
|
1278
|
+
let ok = false;
|
|
1279
|
+
if (now) {
|
|
1280
|
+
const span = {
|
|
1281
|
+
paragraphId: now.id,
|
|
1282
|
+
from: engineOffset(p, use.offset, true),
|
|
1283
|
+
to: engineOffset(p, use.offset + use.text.length)
|
|
1284
|
+
};
|
|
1285
|
+
try {
|
|
1286
|
+
ok = replaceSpan(port, span, insert, term.length);
|
|
1287
|
+
} catch {
|
|
1288
|
+
ok = false;
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
if (ok) {
|
|
1292
|
+
done.push(use);
|
|
1293
|
+
changed.push({ ...use, to: term, linked: Boolean(link) });
|
|
1294
|
+
} else skipped.push({ ...use, reason: "refused" });
|
|
1295
|
+
}
|
|
1296
|
+
const want = replacedText(p.text, done, term);
|
|
1297
|
+
const got = current()?.text;
|
|
1298
|
+
if (got !== want)
|
|
1299
|
+
throw new TermEverywhereError(
|
|
1300
|
+
`A paragraph did not read as intended after the changes: expected "${want}", got "${got ?? "(missing)"}".`
|
|
1301
|
+
);
|
|
1302
|
+
}
|
|
1303
|
+
changed.sort(
|
|
1304
|
+
(a, b) => paragraphs.findIndex((p) => p.id === a.paragraphId) - paragraphs.findIndex((p) => p.id === b.paragraphId) || a.offset - b.offset
|
|
1305
|
+
);
|
|
1306
|
+
return { changed, skipped, addedDefinition };
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1105
1309
|
// src/commands/index.ts
|
|
1106
1310
|
function documentReader(view) {
|
|
1107
1311
|
const root = () => view.part().root;
|
|
@@ -1150,9 +1354,11 @@ exports.DEFINITIONS_HEADING = DEFINITIONS_HEADING;
|
|
|
1150
1354
|
exports.DEFINITION_BOOKMARK_PREFIX = DEFINITION_BOOKMARK_PREFIX;
|
|
1151
1355
|
exports.FIELD_ATOM = FIELD_ATOM;
|
|
1152
1356
|
exports.REF_BOOKMARK_PREFIX = REF_BOOKMARK_PREFIX;
|
|
1357
|
+
exports.TermEverywhereError = TermEverywhereError;
|
|
1153
1358
|
exports.WATCHED_STYLES = WATCHED_STYLES;
|
|
1154
1359
|
exports.W_NAMESPACES = W_NAMESPACES;
|
|
1155
1360
|
exports.addDefinition = addDefinition;
|
|
1361
|
+
exports.applyTermEverywhere = applyTermEverywhere;
|
|
1156
1362
|
exports.brokenCrossReferences = brokenCrossReferences;
|
|
1157
1363
|
exports.compareTerms = compareTerms;
|
|
1158
1364
|
exports.crossReferenceXml = crossReferenceXml;
|
|
@@ -1170,11 +1376,14 @@ exports.documentReferenceTooltip = documentReferenceTooltip;
|
|
|
1170
1376
|
exports.documentStyleIds = documentStyleIds;
|
|
1171
1377
|
exports.documentXml = documentXml;
|
|
1172
1378
|
exports.docxPackage = docxPackage;
|
|
1379
|
+
exports.engineLength = engineLength;
|
|
1380
|
+
exports.engineOffset = engineOffset;
|
|
1173
1381
|
exports.ensureTargetBookmark = ensureTargetBookmark;
|
|
1174
1382
|
exports.esc = esc;
|
|
1175
1383
|
exports.fieldNodeIds = fieldNodeIds;
|
|
1176
1384
|
exports.filterTargets = filterTargets;
|
|
1177
1385
|
exports.findDefinitionsSection = findDefinitionsSection;
|
|
1386
|
+
exports.findTermUses = findTermUses;
|
|
1178
1387
|
exports.fragmentPackage = fragmentPackage;
|
|
1179
1388
|
exports.headingParagraphXml = headingParagraphXml;
|
|
1180
1389
|
exports.hyperlinkRelationship = hyperlinkRelationship;
|
|
@@ -1199,6 +1408,7 @@ exports.refInstruction = refInstruction;
|
|
|
1199
1408
|
exports.refResult = refResult;
|
|
1200
1409
|
exports.refTooltip = refTooltip;
|
|
1201
1410
|
exports.refreshCrossReferences = refreshCrossReferences;
|
|
1411
|
+
exports.replaceSpan = replaceSpan;
|
|
1202
1412
|
exports.sectionStates = sectionStates;
|
|
1203
1413
|
exports.staleCrossReferences = staleCrossReferences;
|
|
1204
1414
|
exports.styleNames = styleNames;
|