@hwp-editor/react 1.4.0 → 1.4.2
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/index.cjs +212 -142
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +3 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +91 -21
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.css
CHANGED
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme.css","../src/editor.css"],"sourcesContent":["/**\n * Theme contract for @hwp-editor/react. Hosts theme the editor ONLY by\n * overriding these variables on the editor root or any ancestor:\n *\n * --hwped-bg surface background\n * --hwped-fg primary text\n * --hwped-muted secondary text / disabled\n * --hwped-accent primary actions, selection\n * --hwped-border hairline borders\n * --hwped-error destructive / error text and badges\n * --hwped-warning transient warning (timeout badge only)\n * --hwped-success success badge\n * --hwped-radius corner radius\n * --hwped-font font stack (default: Pretendard -> system)\n *\n * Defaults below include a prefers-color-scheme dark fallback.\n */\n\n.hwped {\n --hwped-bg: #ffffff;\n --hwped-fg: #1a1d21;\n --hwped-muted: #6b7280;\n --hwped-accent: #1f5fbf;\n --hwped-border: #d7dbe0;\n --hwped-error: #b91c1c;\n --hwped-warning: #a16207;\n --hwped-success: #15803d;\n --hwped-radius: 6px;\n --hwped-font:\n \"Pretendard\", \"Pretendard Variable\", \"Malgun Gothic\", \"맑은 고딕\",\n -apple-system, \"Segoe UI\", Roboto, \"Noto Sans KR\", sans-serif;\n}\n\n@media (prefers-color-scheme: dark) {\n .hwped {\n --hwped-bg: #17191d;\n --hwped-fg: #e5e7eb;\n --hwped-muted: #9ca3af;\n --hwped-accent: #5b8def;\n --hwped-border: #33373f;\n /* Lifted for >= 4.5:1 against --hwped-bg at 11-13px. */\n --hwped-error: #f87171;\n --hwped-warning: #fbbf24;\n --hwped-success: #4ade80;\n }\n}\n","/**\n * Scoped stylesheet for @hwp-editor/react. Every class carries the `hwped`\n * prefix; the root element gets `.hwped.hwped-root`. No global selectors,\n * no component-kit assumptions.\n *\n * Design notes (HIG-derived, #34): depth comes from tone and shadow rather\n * than extra lines; every control answers on press, not on release; status\n * is tinted by kind; motion is short, and dropped under reduced motion.\n *\n * Every tone below is DERIVED from the public --hwped-* tokens with\n * color-mix, so a host that maps those tokens (light or dark) gets the whole\n * palette. The --_hwped-* names are private and not part of the contract.\n */\n\n.hwped {\n --_hwped-desk: color-mix(in srgb, var(--hwped-fg) 5%, var(--hwped-bg));\n --_hwped-fill: color-mix(in srgb, var(--hwped-fg) 7%, var(--hwped-bg));\n --_hwped-hover: color-mix(in srgb, var(--hwped-accent) 9%, var(--hwped-bg));\n --_hwped-press: color-mix(in srgb, var(--hwped-accent) 16%, var(--hwped-bg));\n --_hwped-hairline: color-mix(in srgb, var(--hwped-border) 75%, transparent);\n --_hwped-ring: 0 0 0 3px color-mix(in srgb, var(--hwped-accent) 35%, transparent);\n --_hwped-quick: 100ms ease-out;\n\n background: var(--hwped-bg);\n color: var(--hwped-fg);\n font-family: var(--hwped-font);\n font-size: 13px;\n line-height: 1.5;\n -webkit-font-smoothing: antialiased;\n}\n\n.hwped *,\n.hwped *::before,\n.hwped *::after {\n box-sizing: border-box;\n}\n\n.hwped-root {\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 320px;\n border: 1px solid var(--hwped-border);\n border-radius: var(--hwped-radius);\n overflow: hidden;\n}\n\n/* ---- toolbar ---- */\n\n.hwped-toolbar {\n display: flex;\n align-items: center;\n gap: 8px;\n min-height: 44px;\n padding: 6px 12px;\n border-bottom: 1px solid var(--_hwped-hairline);\n background: var(--hwped-bg);\n flex: 0 0 auto;\n position: relative;\n z-index: 1;\n}\n\n.hwped-title {\n font-weight: 600;\n letter-spacing: -0.01em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 40%;\n}\n\n.hwped-spacer {\n flex: 1 1 auto;\n}\n\n/* The title and this notice are the only toolbar items that may shrink: a\n long engine reason truncates here (the full text stays reachable via the\n element's title attribute) instead of being distributed across the badge,\n count and buttons, which would collapse them to min-content and stack the\n row. That is why every sibling below carries `flex: 0 0 auto` (G-03-1). */\n.hwped-notice {\n color: var(--hwped-muted);\n background: var(--_hwped-fill);\n border-radius: 999px;\n padding: 2px 10px;\n font-size: 12px;\n letter-spacing: 0.01em;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 0 1 auto;\n}\n\n/* Status reads by kind, not by outline: a tinted pill in the kind's color. */\n.hwped-badge {\n border-radius: 999px;\n padding: 2px 10px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.01em;\n border: 1px solid transparent;\n background: var(--_hwped-fill);\n flex: 0 0 auto;\n}\n\n.hwped-badge-ok {\n color: var(--hwped-success);\n background: color-mix(in srgb, var(--hwped-success) 14%, transparent);\n}\n\n.hwped-badge-err {\n color: var(--hwped-error);\n background: color-mix(in srgb, var(--hwped-error) 14%, transparent);\n}\n\n.hwped-count {\n color: var(--hwped-muted);\n font-size: 12px;\n letter-spacing: 0.01em;\n font-variant-numeric: tabular-nums;\n flex: 0 0 auto;\n}\n\n/* ---- buttons / inputs ---- */\n\n.hwped-btn {\n font: inherit;\n font-weight: 500;\n color: var(--hwped-fg);\n background: var(--hwped-bg);\n border: 1px solid var(--hwped-border);\n border-radius: var(--hwped-radius);\n min-height: 28px;\n padding: 3px 12px;\n cursor: pointer;\n transition:\n background-color var(--_hwped-quick),\n border-color var(--_hwped-quick),\n transform var(--_hwped-quick);\n}\n\n.hwped-btn:hover:not(:disabled) {\n background: var(--_hwped-hover);\n border-color: color-mix(in srgb, var(--hwped-accent) 55%, var(--hwped-border));\n}\n\n/* Feedback on press, instantly - never only on release. */\n.hwped-btn:active:not(:disabled) {\n background: var(--_hwped-press);\n transform: scale(0.97);\n}\n\n.hwped-btn:disabled {\n color: var(--hwped-muted);\n background: transparent;\n border-color: var(--_hwped-hairline);\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.hwped-btn-primary {\n background: var(--hwped-accent);\n border-color: var(--hwped-accent);\n color: #ffffff;\n font-weight: 600;\n}\n\n.hwped-btn-primary:hover:not(:disabled) {\n background: color-mix(in srgb, var(--hwped-accent) 88%, #000000);\n border-color: color-mix(in srgb, var(--hwped-accent) 88%, #000000);\n}\n\n.hwped-btn-primary:active:not(:disabled) {\n background: color-mix(in srgb, var(--hwped-accent) 78%, #000000);\n}\n\n/* A disabled primary keeps a trace of its accent, but must not read as live. */\n.hwped-btn-primary:disabled {\n color: var(--hwped-muted);\n background: color-mix(in srgb, var(--hwped-accent) 14%, var(--hwped-bg));\n border-color: transparent;\n opacity: 1;\n}\n\n/* Destructive reads as destructive at rest, not only on hover. */\n.hwped-btn-danger {\n color: var(--hwped-error);\n}\n\n.hwped-btn-danger:hover:not(:disabled) {\n border-color: var(--hwped-error);\n color: var(--hwped-error);\n background: color-mix(in srgb, var(--hwped-error) 9%, var(--hwped-bg));\n}\n\n.hwped-btn-link {\n border: none;\n background: none;\n min-height: 0;\n padding: 0;\n color: var(--hwped-accent);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n\n.hwped-btn-link:hover:not(:disabled) {\n background: none;\n}\n\n/* Scoped to direct toolbar children on purpose: `.hwped-btn` is reused by\n SegmentInspector, TableGrid, FieldsPanel, the compose dialog actions and\n the empty-state button, where non-shrinkable buttons would trade this bug\n for horizontal overflow in those narrow rows. */\n.hwped-toolbar > .hwped-btn {\n flex: 0 0 auto;\n}\n\n.hwped-input,\n.hwped-textarea {\n font: inherit;\n color: var(--hwped-fg);\n background: var(--hwped-bg);\n border: 1px solid var(--hwped-border);\n border-radius: var(--hwped-radius);\n min-height: 28px;\n padding: 4px 9px;\n width: 100%;\n transition:\n border-color var(--_hwped-quick),\n box-shadow var(--_hwped-quick);\n}\n\n.hwped-input::placeholder,\n.hwped-textarea::placeholder {\n color: var(--hwped-muted);\n opacity: 0.8;\n}\n\n.hwped-input:hover:not(:disabled),\n.hwped-textarea:hover:not(:disabled) {\n border-color: color-mix(in srgb, var(--hwped-fg) 30%, var(--hwped-border));\n}\n\n/* One focus treatment everywhere: accent edge plus a soft ring. */\n.hwped-input:focus,\n.hwped-textarea:focus {\n outline: none;\n border-color: var(--hwped-accent);\n box-shadow: var(--_hwped-ring);\n}\n\n.hwped-btn:focus-visible,\n.hwped-tab:focus-visible,\n.hwped-preset:focus-visible,\n.hwped-cell:focus-visible {\n outline: none;\n box-shadow: var(--_hwped-ring);\n}\n\n.hwped-input-narrow {\n width: 96px;\n flex: 0 0 auto;\n}\n\n.hwped-check {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n cursor: pointer;\n}\n\n.hwped-check input {\n accent-color: var(--hwped-accent);\n}\n\n/* ---- layout ---- */\n\n.hwped-pending-list {\n flex: 0 1 auto;\n min-height: 0;\n max-height: 120px;\n overflow: auto;\n overflow-wrap: anywhere;\n}\n\n.hwped-main {\n display: flex;\n flex: 1 1 auto;\n min-height: 0;\n}\n\n/* The desk: a tone below the chrome, so the page reads as a sheet on it. */\n.hwped-canvas {\n flex: 1 1 auto;\n overflow: auto;\n padding: 24px;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 24px;\n background: var(--_hwped-desk);\n}\n\n.hwped-side {\n flex: 0 0 300px;\n border-left: 1px solid var(--_hwped-hairline);\n background: var(--hwped-bg);\n display: flex;\n flex-direction: column;\n min-height: 0;\n}\n\n/* Tabs as a segmented control: a recessed track, the active segment raised. */\n.hwped-tabs {\n display: flex;\n flex-wrap: wrap;\n gap: 2px;\n margin: 10px 12px 2px;\n padding: 3px;\n background: var(--_hwped-fill);\n border-radius: calc(var(--hwped-radius) + 2px);\n flex: 0 0 auto;\n}\n\n.hwped-tab {\n font: inherit;\n font-weight: 500;\n flex: 1 1 78px;\n min-width: 0;\n min-height: 26px;\n padding: 3px 0;\n background: none;\n border: none;\n border-radius: var(--hwped-radius);\n color: var(--hwped-muted);\n cursor: pointer;\n transition:\n background-color var(--_hwped-quick),\n color var(--_hwped-quick),\n transform var(--_hwped-quick);\n}\n\n.hwped-tab:hover:not(.hwped-tab-active) {\n color: var(--hwped-fg);\n}\n\n.hwped-tab:active {\n transform: scale(0.97);\n}\n\n.hwped-tab-active {\n color: var(--hwped-fg);\n background: var(--hwped-bg);\n font-weight: 600;\n box-shadow:\n 0 1px 2px rgba(0, 0, 0, 0.12),\n 0 0 0 0.5px rgba(0, 0, 0, 0.06);\n}\n\n.hwped-panel {\n padding: 12px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n\n.hwped-field {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.hwped-label {\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.01em;\n line-height: 1.35;\n color: color-mix(in srgb, var(--hwped-fg) 72%, var(--hwped-bg));\n}\n\n.hwped-row {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-wrap: wrap;\n}\n\n/* A role=\"group\" row of peer actions (alignment) reads as one joined control. */\n.hwped-row[role=\"group\"] {\n gap: 0;\n flex-wrap: nowrap;\n}\n\n.hwped-row[role=\"group\"] > .hwped-btn {\n flex: 1 1 0;\n padding-inline: 6px;\n border-radius: 0;\n margin-left: -1px;\n}\n\n.hwped-row[role=\"group\"] > .hwped-btn:first-child {\n margin-left: 0;\n border-radius: var(--hwped-radius) 0 0 var(--hwped-radius);\n}\n\n.hwped-row[role=\"group\"] > .hwped-btn:last-child {\n border-radius: 0 var(--hwped-radius) var(--hwped-radius) 0;\n}\n\n.hwped-row[role=\"group\"] > .hwped-btn:hover:not(:disabled),\n.hwped-row[role=\"group\"] > .hwped-btn:focus-visible {\n position: relative;\n z-index: 1;\n}\n\n.hwped-quote {\n background: var(--_hwped-fill);\n border-radius: var(--hwped-radius);\n padding: 8px 10px;\n max-height: 120px;\n overflow: auto;\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n.hwped-hint,\n.hwped-empty {\n color: var(--hwped-muted);\n}\n\n.hwped-empty {\n margin: auto;\n text-align: center;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 12px;\n}\n\n/* An error is a band in the kind's tint with a leading bar, not bare red text. */\n.hwped-error {\n color: var(--hwped-error);\n margin: 0;\n padding: 8px 12px;\n background: color-mix(in srgb, var(--hwped-error) 9%, var(--hwped-bg));\n border-bottom: 1px solid var(--_hwped-hairline);\n box-shadow: inset 3px 0 0 currentColor;\n}\n\n.hwped-error-kind {\n display: inline-block;\n margin-right: 8px;\n padding: 0 8px;\n border-radius: 999px;\n background: color-mix(in srgb, currentColor 14%, transparent);\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.02em;\n}\n\n/* timeout is transient (retry may succeed); unavailable/protected are not. */\n.hwped-error-timeout {\n color: var(--hwped-warning);\n background: color-mix(in srgb, var(--hwped-warning) 10%, var(--hwped-bg));\n}\n\n/* ---- page canvas ---- */\n\n/* Paper on the desk: layered shadow, the larger layer giving it thickness. */\n.hwped-page {\n position: relative;\n width: min(100%, 720px);\n border-radius: 3px;\n box-shadow:\n 0 0 0 1px color-mix(in srgb, var(--hwped-fg) 8%, transparent),\n 0 1px 2px rgba(0, 0, 0, 0.08),\n 0 8px 24px rgba(0, 0, 0, 0.12);\n background: #ffffff;\n cursor: text;\n}\n\n.hwped-page:focus-visible {\n outline: 2px solid var(--hwped-accent);\n outline-offset: 3px;\n}\n\n.hwped-page-img {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n.hwped-band {\n position: absolute;\n left: 0;\n right: 0;\n pointer-events: none;\n transition: background-color var(--_hwped-quick);\n}\n\n/* Mark the selection without covering it: a light wash and an inset rule. */\n.hwped-band-selected {\n background: color-mix(in srgb, var(--hwped-accent) 9%, transparent);\n box-shadow:\n inset 3px 0 0 var(--hwped-accent),\n inset 0 0 0 1px color-mix(in srgb, var(--hwped-accent) 45%, transparent);\n}\n\n.hwped-band-pending {\n background: color-mix(in srgb, var(--hwped-accent) 6%, transparent);\n box-shadow: inset 3px 0 0 color-mix(in srgb, var(--hwped-accent) 45%, transparent);\n}\n\n/* ---- table grid ---- */\n\n.hwped-grid {\n border-collapse: collapse;\n width: 100%;\n}\n\n.hwped-grid td {\n border: 1px solid var(--hwped-border);\n padding: 0;\n}\n\n.hwped-cell {\n font: inherit;\n display: block;\n width: 100%;\n border: none;\n background: none;\n color: var(--hwped-fg);\n padding: 5px 8px;\n text-align: left;\n cursor: pointer;\n min-height: 28px;\n transition: background-color var(--_hwped-quick);\n}\n\n.hwped-cell:hover {\n background: var(--_hwped-hover);\n}\n\n.hwped-cell:active {\n background: var(--_hwped-press);\n}\n\n.hwped-cell-selected {\n outline: 2px solid var(--hwped-accent);\n outline-offset: -2px;\n}\n\n.hwped-cell-anchor {\n background: color-mix(in srgb, var(--hwped-accent) 14%, transparent);\n}\n\n/* ---- fields ---- */\n\n.hwped-fields {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.hwped-field-item {\n border-bottom: 1px solid var(--_hwped-hairline);\n padding-bottom: 10px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n/* ---- compose dialog ---- */\n\n/* Dim to focus: a modal task gets a scrim that pushes the editor back. */\n.hwped-overlay {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.32);\n backdrop-filter: blur(6px) saturate(120%);\n -webkit-backdrop-filter: blur(6px) saturate(120%);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n animation: hwped-fade-in 160ms ease-out;\n}\n\n.hwped-dialog {\n background: var(--hwped-bg);\n color: var(--hwped-fg);\n border: 1px solid var(--_hwped-hairline);\n border-radius: calc(var(--hwped-radius) * 2);\n box-shadow:\n 0 2px 8px rgba(0, 0, 0, 0.12),\n 0 24px 64px rgba(0, 0, 0, 0.28);\n width: min(560px, calc(100vw - 32px));\n max-height: calc(100vh - 64px);\n overflow: auto;\n padding: 20px;\n display: flex;\n flex-direction: column;\n gap: 14px;\n animation: hwped-materialize 200ms cubic-bezier(0.2, 0.8, 0.2, 1);\n}\n\n.hwped-dialog-title {\n margin: 0;\n font-size: 17px;\n font-weight: 600;\n line-height: 1.3;\n letter-spacing: -0.015em;\n}\n\n.hwped-presets {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.hwped-preset {\n font: inherit;\n font-weight: 500;\n border: 1px solid var(--hwped-border);\n border-radius: 999px;\n background: var(--hwped-bg);\n color: var(--hwped-fg);\n min-height: 28px;\n padding: 3px 12px;\n cursor: pointer;\n transition:\n background-color var(--_hwped-quick),\n border-color var(--_hwped-quick),\n transform var(--_hwped-quick);\n}\n\n.hwped-preset:hover:not(.hwped-preset-active) {\n background: var(--_hwped-hover);\n}\n\n.hwped-preset:active {\n transform: scale(0.97);\n}\n\n.hwped-preset-active {\n border-color: var(--hwped-accent);\n background: color-mix(in srgb, var(--hwped-accent) 12%, var(--hwped-bg));\n color: var(--hwped-accent);\n font-weight: 600;\n}\n\n.hwped-dialog-actions {\n justify-content: flex-end;\n padding-top: 4px;\n}\n\n@keyframes hwped-fade-in {\n from {\n opacity: 0;\n }\n}\n\n/* Materialize, don't just fade: the surface arrives with a slight scale. */\n@keyframes hwped-materialize {\n from {\n opacity: 0;\n transform: scale(0.98);\n }\n}\n\n/* ---- accessibility preferences ---- */\n\n@media (prefers-reduced-motion: reduce) {\n .hwped *,\n .hwped *::before,\n .hwped *::after {\n transition-duration: 0ms !important;\n }\n\n .hwped-btn:active:not(:disabled),\n .hwped-tab:active,\n .hwped-preset:active {\n transform: none;\n }\n\n .hwped-overlay,\n .hwped-dialog {\n animation: none;\n }\n}\n\n@media (prefers-reduced-transparency: reduce) {\n .hwped-overlay {\n background: rgba(0, 0, 0, 0.55);\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n }\n}\n\n@media (prefers-contrast: more) {\n .hwped {\n --_hwped-hairline: var(--hwped-fg);\n }\n\n .hwped-btn,\n .hwped-input,\n .hwped-textarea,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AAAA,IACpC,aAAa,IAAI,eAAe;AAAA,IAChC,UAAU,IAAI;AAClB;AAEA,CAnYC,YAmYY,MAAM,KAAK,CAAC;AACvB,cAAY,IAAI;AAClB;AAEA,CAvYC,YAuYY;AACX,aAAW,MAAM;AACnB;AAEA,CARyB;AASvB,gBAAc,IAAI;AAClB,cAAY,UAAU,GAAG,IAAI,EAAE,IAAI,gBAAgB,GAAG,EAAE,IAAI;AAC5D,SAAO,IAAI;AACX,eAAa;AACf;AAEA,CAAC;AACC,mBAAiB;AACjB,eAAa;AACf;AAEA,WAvEa;AAwEX;AACE,aAAS;AACX;AACF;AAGA,WA5Da;AA6DX;AACE,aAAS;AACT,eAAW,MAAM;AACnB;AACF;AAIA,QAAO,wBAAyB;AAC9B,GAxpBD,MAwpBQ;AAAA,EACP,CAzpBD,MAypBQ,CAAC;AAAA,EACR,CA1pBD,MA0pBQ,CAAC;AACN,yBAAqB;AACvB;AAEA,GA9iBD,SA8iBW,OAAO,KAAK;AAAA,EACtB,CAhbD,SAgbW;AAAA,EACV,CAhbD,YAgbc;AACX,eAAW;AACb;AAEA,GA9GD;AAAA,EA+GC,CAlGD;AAmGG,eAAW;AACb;AACF;AAEA,QAAO,8BAA+B;AACpC,GArHD;AAsHG,gBAAY,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAC1B,qBAAiB;AACjB,6BAAyB;AAC3B;AACF;AAEA,QAAO,kBAAmB;AACxB,GAnrBD;AAorBG,uBAAmB,IAAI;AACzB;AAEA,GAvkBD;AAAA,EAwkBC,CA5eD;AAAA,EA6eC,CA5eD;AAAA,EA6eC,CA1cD;AAAA,EA2cC,CApMD,WAoMa;AACV,kBAAc,IAAI;AACpB;AAEA,GAnZD;AAoZG,gBAAY,MAAM,EAAE,EAAE,EAAE,IAAI,IAAI;AAClC;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/theme.css","../src/editor.css"],"sourcesContent":["/**\n * Theme contract for @hwp-editor/react. Hosts theme the editor ONLY by\n * overriding these variables on the editor root or any ancestor:\n *\n * --hwped-bg surface background\n * --hwped-fg primary text\n * --hwped-muted secondary text / disabled\n * --hwped-accent primary actions, selection\n * --hwped-border hairline borders\n * --hwped-error destructive / error text and badges\n * --hwped-warning transient warning (timeout badge only)\n * --hwped-success success badge\n * --hwped-radius corner radius\n * --hwped-font font stack (default: Pretendard -> system)\n *\n * Defaults below include a prefers-color-scheme dark fallback.\n */\n\n.hwped {\n --hwped-bg: #ffffff;\n --hwped-fg: #1a1d21;\n --hwped-muted: #6b7280;\n --hwped-accent: #1f5fbf;\n --hwped-border: #d7dbe0;\n --hwped-error: #b91c1c;\n --hwped-warning: #a16207;\n --hwped-success: #15803d;\n --hwped-radius: 6px;\n --hwped-font:\n \"Pretendard\", \"Pretendard Variable\", \"Malgun Gothic\", \"맑은 고딕\",\n -apple-system, \"Segoe UI\", Roboto, \"Noto Sans KR\", sans-serif;\n}\n\n@media (prefers-color-scheme: dark) {\n .hwped {\n --hwped-bg: #17191d;\n --hwped-fg: #e5e7eb;\n --hwped-muted: #9ca3af;\n --hwped-accent: #5b8def;\n --hwped-border: #33373f;\n /* Lifted for >= 4.5:1 against --hwped-bg at 11-13px. */\n --hwped-error: #f87171;\n --hwped-warning: #fbbf24;\n --hwped-success: #4ade80;\n }\n}\n","/**\n * Scoped stylesheet for @hwp-editor/react. Every class carries the `hwped`\n * prefix; the root element gets `.hwped.hwped-root`. No global selectors,\n * no component-kit assumptions.\n *\n * Design notes (HIG-derived, #34): depth comes from tone and shadow rather\n * than extra lines; every control answers on press, not on release; status\n * is tinted by kind; motion is short, and dropped under reduced motion.\n *\n * Every tone below is DERIVED from the public --hwped-* tokens with\n * color-mix, so a host that maps those tokens (light or dark) gets the whole\n * palette. The --_hwped-* names are private and not part of the contract.\n */\n\n.hwped {\n --_hwped-desk: color-mix(in srgb, var(--hwped-fg) 5%, var(--hwped-bg));\n --_hwped-fill: color-mix(in srgb, var(--hwped-fg) 7%, var(--hwped-bg));\n --_hwped-hover: color-mix(in srgb, var(--hwped-accent) 9%, var(--hwped-bg));\n --_hwped-press: color-mix(in srgb, var(--hwped-accent) 16%, var(--hwped-bg));\n --_hwped-hairline: color-mix(in srgb, var(--hwped-border) 75%, transparent);\n --_hwped-ring: 0 0 0 3px color-mix(in srgb, var(--hwped-accent) 35%, transparent);\n --_hwped-quick: 100ms ease-out;\n\n background: var(--hwped-bg);\n color: var(--hwped-fg);\n font-family: var(--hwped-font);\n font-size: 13px;\n line-height: 1.5;\n -webkit-font-smoothing: antialiased;\n}\n\n.hwped *,\n.hwped *::before,\n.hwped *::after {\n box-sizing: border-box;\n}\n\n.hwped-root {\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 320px;\n border: 1px solid var(--hwped-border);\n border-radius: var(--hwped-radius);\n overflow: hidden;\n}\n\n/* ---- toolbar ---- */\n\n.hwped-toolbar {\n display: flex;\n align-items: center;\n gap: 8px;\n min-height: 44px;\n padding: 6px 12px;\n border-bottom: 1px solid var(--_hwped-hairline);\n background: var(--hwped-bg);\n flex: 0 0 auto;\n position: relative;\n z-index: 1;\n}\n\n.hwped-title {\n font-weight: 600;\n letter-spacing: -0.01em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 40%;\n}\n\n.hwped-spacer {\n flex: 1 1 auto;\n}\n\n/* The title and this notice are the only toolbar items that may shrink: a\n long engine reason truncates here (the full text stays reachable via the\n element's title attribute) instead of being distributed across the badge,\n count and buttons, which would collapse them to min-content and stack the\n row. That is why every sibling below carries `flex: 0 0 auto` (G-03-1). */\n.hwped-notice {\n color: var(--hwped-muted);\n background: var(--_hwped-fill);\n border-radius: 999px;\n padding: 2px 10px;\n font-size: 12px;\n letter-spacing: 0.01em;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 0 1 auto;\n}\n\n/* Status reads by kind, not by outline: a tinted pill in the kind's color. */\n.hwped-badge {\n border-radius: 999px;\n padding: 2px 10px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.01em;\n border: 1px solid transparent;\n background: var(--_hwped-fill);\n flex: 0 0 auto;\n}\n\n.hwped-badge-ok {\n color: var(--hwped-success);\n background: color-mix(in srgb, var(--hwped-success) 14%, transparent);\n}\n\n.hwped-badge-err {\n color: var(--hwped-error);\n background: color-mix(in srgb, var(--hwped-error) 14%, transparent);\n}\n\n.hwped-count {\n color: var(--hwped-muted);\n font-size: 12px;\n letter-spacing: 0.01em;\n font-variant-numeric: tabular-nums;\n flex: 0 0 auto;\n}\n\n/* ---- buttons / inputs ---- */\n\n.hwped-btn {\n font: inherit;\n font-weight: 500;\n color: var(--hwped-fg);\n background: var(--hwped-bg);\n border: 1px solid var(--hwped-border);\n border-radius: var(--hwped-radius);\n min-height: 28px;\n padding: 3px 12px;\n cursor: pointer;\n transition:\n background-color var(--_hwped-quick),\n border-color var(--_hwped-quick),\n transform var(--_hwped-quick);\n}\n\n.hwped-btn:hover:not(:disabled) {\n background: var(--_hwped-hover);\n border-color: color-mix(in srgb, var(--hwped-accent) 55%, var(--hwped-border));\n}\n\n/* Feedback on press, instantly - never only on release. */\n.hwped-btn:active:not(:disabled) {\n background: var(--_hwped-press);\n transform: scale(0.97);\n}\n\n.hwped-btn:disabled {\n color: var(--hwped-muted);\n background: transparent;\n border-color: var(--_hwped-hairline);\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.hwped-btn-primary {\n background: var(--hwped-accent);\n border-color: var(--hwped-accent);\n color: #ffffff;\n font-weight: 600;\n}\n\n.hwped-btn-primary:hover:not(:disabled) {\n background: color-mix(in srgb, var(--hwped-accent) 88%, #000000);\n border-color: color-mix(in srgb, var(--hwped-accent) 88%, #000000);\n}\n\n.hwped-btn-primary:active:not(:disabled) {\n background: color-mix(in srgb, var(--hwped-accent) 78%, #000000);\n}\n\n/* A disabled primary keeps a trace of its accent, but must not read as live. */\n.hwped-btn-primary:disabled {\n color: var(--hwped-muted);\n background: color-mix(in srgb, var(--hwped-accent) 14%, var(--hwped-bg));\n border-color: transparent;\n opacity: 1;\n}\n\n/* Destructive reads as destructive at rest, not only on hover. */\n.hwped-btn-danger {\n color: var(--hwped-error);\n}\n\n.hwped-btn-danger:hover:not(:disabled) {\n border-color: var(--hwped-error);\n color: var(--hwped-error);\n background: color-mix(in srgb, var(--hwped-error) 9%, var(--hwped-bg));\n}\n\n.hwped-btn-link {\n border: none;\n background: none;\n min-height: 0;\n padding: 0;\n color: var(--hwped-accent);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n\n.hwped-btn-link:hover:not(:disabled) {\n background: none;\n}\n\n/* Scoped to direct toolbar children on purpose: `.hwped-btn` is reused by\n SegmentInspector, TableGrid, FieldsPanel, the compose dialog actions and\n the empty-state button, where non-shrinkable buttons would trade this bug\n for horizontal overflow in those narrow rows. */\n.hwped-toolbar > .hwped-btn {\n flex: 0 0 auto;\n}\n\n.hwped-input,\n.hwped-textarea {\n font: inherit;\n color: var(--hwped-fg);\n background: var(--hwped-bg);\n border: 1px solid var(--hwped-border);\n border-radius: var(--hwped-radius);\n min-height: 28px;\n padding: 4px 9px;\n width: 100%;\n transition:\n border-color var(--_hwped-quick),\n box-shadow var(--_hwped-quick);\n}\n\n.hwped-input::placeholder,\n.hwped-textarea::placeholder {\n color: var(--hwped-muted);\n opacity: 0.8;\n}\n\n.hwped-input:hover:not(:disabled),\n.hwped-textarea:hover:not(:disabled) {\n border-color: color-mix(in srgb, var(--hwped-fg) 30%, var(--hwped-border));\n}\n\n/* One focus treatment everywhere: accent edge plus a soft ring. */\n.hwped-input:focus,\n.hwped-textarea:focus {\n outline: none;\n border-color: var(--hwped-accent);\n box-shadow: var(--_hwped-ring);\n}\n\n.hwped-btn:focus-visible,\n.hwped-tab:focus-visible,\n.hwped-preset:focus-visible,\n.hwped-cell:focus-visible {\n outline: none;\n box-shadow: var(--_hwped-ring);\n}\n\n.hwped-input-narrow {\n width: 96px;\n flex: 0 0 auto;\n}\n\n.hwped-check {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n cursor: pointer;\n}\n\n.hwped-check input {\n accent-color: var(--hwped-accent);\n}\n\n/* ---- layout ---- */\n\n.hwped-pending-list {\n flex: 0 1 auto;\n min-height: 0;\n max-height: 120px;\n overflow: auto;\n overflow-wrap: anywhere;\n}\n\n.hwped-main {\n display: flex;\n flex: 1 1 auto;\n min-height: 0;\n}\n\n/* The desk: a tone below the chrome, so the page reads as a sheet on it. */\n.hwped-canvas {\n flex: 1 1 auto;\n overflow: auto;\n padding: 24px;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 24px;\n background: var(--_hwped-desk);\n}\n\n.hwped-side {\n flex: 0 0 300px;\n border-left: 1px solid var(--_hwped-hairline);\n background: var(--hwped-bg);\n display: flex;\n flex-direction: column;\n min-height: 0;\n}\n\n/* Tabs as a segmented control: a recessed track, the active segment raised. */\n.hwped-tabs {\n display: flex;\n flex-wrap: wrap;\n gap: 2px;\n margin: 10px 12px 2px;\n padding: 3px;\n background: var(--_hwped-fill);\n border-radius: calc(var(--hwped-radius) + 2px);\n flex: 0 0 auto;\n}\n\n.hwped-tab {\n font: inherit;\n font-weight: 500;\n flex: 1 1 78px;\n min-width: 0;\n min-height: 26px;\n padding: 3px 0;\n background: none;\n border: none;\n border-radius: var(--hwped-radius);\n color: var(--hwped-muted);\n cursor: pointer;\n transition:\n background-color var(--_hwped-quick),\n color var(--_hwped-quick),\n transform var(--_hwped-quick);\n}\n\n.hwped-tab:hover:not(.hwped-tab-active) {\n color: var(--hwped-fg);\n}\n\n.hwped-tab:active {\n transform: scale(0.97);\n}\n\n.hwped-tab-active {\n color: var(--hwped-fg);\n background: var(--hwped-bg);\n font-weight: 600;\n box-shadow:\n 0 1px 2px rgba(0, 0, 0, 0.12),\n 0 0 0 0.5px rgba(0, 0, 0, 0.06);\n}\n\n.hwped-panel {\n padding: 12px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n\n.hwped-field {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.hwped-label {\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.01em;\n line-height: 1.35;\n color: color-mix(in srgb, var(--hwped-fg) 72%, var(--hwped-bg));\n}\n\n.hwped-row {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-wrap: wrap;\n}\n\n/* A role=\"group\" row of peer actions (alignment) reads as one joined control. */\n.hwped-row[role=\"group\"] {\n gap: 0;\n flex-wrap: nowrap;\n}\n\n.hwped-row[role=\"group\"] > .hwped-btn {\n flex: 1 1 0;\n padding-inline: 6px;\n border-radius: 0;\n margin-left: -1px;\n}\n\n.hwped-row[role=\"group\"] > .hwped-btn:first-child {\n margin-left: 0;\n border-radius: var(--hwped-radius) 0 0 var(--hwped-radius);\n}\n\n.hwped-row[role=\"group\"] > .hwped-btn:last-child {\n border-radius: 0 var(--hwped-radius) var(--hwped-radius) 0;\n}\n\n.hwped-row[role=\"group\"] > .hwped-btn:hover:not(:disabled),\n.hwped-row[role=\"group\"] > .hwped-btn:focus-visible {\n position: relative;\n z-index: 1;\n}\n\n.hwped-quote {\n background: var(--_hwped-fill);\n border-radius: var(--hwped-radius);\n padding: 8px 10px;\n max-height: 120px;\n overflow: auto;\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n.hwped-hint,\n.hwped-empty {\n color: var(--hwped-muted);\n}\n\n.hwped-empty {\n margin: auto;\n text-align: center;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 12px;\n}\n\n/* An error is a band in the kind's tint with a leading bar, not bare red text. */\n.hwped-error {\n color: var(--hwped-error);\n margin: 0;\n padding: 8px 12px;\n background: color-mix(in srgb, var(--hwped-error) 9%, var(--hwped-bg));\n border-bottom: 1px solid var(--_hwped-hairline);\n box-shadow: inset 3px 0 0 currentColor;\n}\n\n.hwped-error-kind {\n display: inline-block;\n margin-right: 8px;\n padding: 0 8px;\n border-radius: 999px;\n background: color-mix(in srgb, currentColor 14%, transparent);\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.02em;\n}\n\n/* timeout is transient (retry may succeed); unavailable/protected are not. */\n.hwped-error-timeout {\n color: var(--hwped-warning);\n background: color-mix(in srgb, var(--hwped-warning) 10%, var(--hwped-bg));\n}\n\n/* ---- page canvas ---- */\n\n/* Paper on the desk: layered shadow, the larger layer giving it thickness. */\n.hwped-page {\n position: relative;\n width: min(100%, 720px);\n border-radius: 3px;\n box-shadow:\n 0 0 0 1px color-mix(in srgb, var(--hwped-fg) 8%, transparent),\n 0 1px 2px rgba(0, 0, 0, 0.08),\n 0 8px 24px rgba(0, 0, 0, 0.12);\n background: #ffffff;\n cursor: text;\n}\n\n.hwped-page:focus-visible {\n outline: 2px solid var(--hwped-accent);\n outline-offset: 3px;\n}\n\n.hwped-page-img {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n.hwped-band {\n position: absolute;\n left: 0;\n right: 0;\n pointer-events: none;\n transition: background-color var(--_hwped-quick);\n}\n\n/* Mark the selection without covering it: a light wash and an inset rule. */\n.hwped-band-selected {\n background: color-mix(in srgb, var(--hwped-accent) 9%, transparent);\n box-shadow:\n inset 3px 0 0 var(--hwped-accent),\n inset 0 0 0 1px color-mix(in srgb, var(--hwped-accent) 45%, transparent);\n}\n\n.hwped-band-pending {\n background: color-mix(in srgb, var(--hwped-accent) 6%, transparent);\n box-shadow: inset 3px 0 0 color-mix(in srgb, var(--hwped-accent) 45%, transparent);\n}\n\n/* ---- table grid ---- */\n\n.hwped-grid {\n border-collapse: collapse;\n width: 100%;\n}\n\n.hwped-grid td {\n border: 1px solid var(--hwped-border);\n padding: 0;\n}\n\n.hwped-cell {\n font: inherit;\n display: block;\n width: 100%;\n border: none;\n background: none;\n color: var(--hwped-fg);\n padding: 5px 8px;\n text-align: left;\n cursor: pointer;\n min-height: 28px;\n transition: background-color var(--_hwped-quick);\n}\n\n.hwped-cell:hover {\n background: var(--_hwped-hover);\n}\n\n.hwped-cell:active {\n background: var(--_hwped-press);\n}\n\n.hwped-cell-selected {\n outline: 2px solid var(--hwped-accent);\n outline-offset: -2px;\n}\n\n.hwped-cell-anchor {\n background: color-mix(in srgb, var(--hwped-accent) 14%, transparent);\n}\n\n/* ---- fields ---- */\n\n.hwped-fields {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.hwped-field-item {\n border-bottom: 1px solid var(--_hwped-hairline);\n padding-bottom: 10px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n/* ---- compose dialog ---- */\n\n/* Dim to focus: a modal task gets a scrim that pushes the editor back. */\n.hwped-overlay {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.32);\n backdrop-filter: blur(6px) saturate(120%);\n -webkit-backdrop-filter: blur(6px) saturate(120%);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n animation: hwped-fade-in 160ms ease-out;\n}\n\n.hwped-dialog {\n background: var(--hwped-bg);\n color: var(--hwped-fg);\n border: 1px solid var(--_hwped-hairline);\n border-radius: calc(var(--hwped-radius) * 2);\n box-shadow:\n 0 2px 8px rgba(0, 0, 0, 0.12),\n 0 24px 64px rgba(0, 0, 0, 0.28);\n width: min(560px, calc(100vw - 32px));\n max-height: calc(100vh - 64px);\n overflow: auto;\n padding: 20px;\n display: flex;\n flex-direction: column;\n gap: 14px;\n animation: hwped-materialize 200ms cubic-bezier(0.2, 0.8, 0.2, 1);\n}\n\n.hwped-dialog-title {\n margin: 0;\n font-size: 17px;\n font-weight: 600;\n line-height: 1.3;\n letter-spacing: -0.015em;\n}\n\n.hwped-presets {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.hwped-preset {\n font: inherit;\n font-weight: 500;\n border: 1px solid var(--hwped-border);\n border-radius: 999px;\n background: var(--hwped-bg);\n color: var(--hwped-fg);\n min-height: 28px;\n padding: 3px 12px;\n cursor: pointer;\n transition:\n background-color var(--_hwped-quick),\n border-color var(--_hwped-quick),\n transform var(--_hwped-quick);\n}\n\n.hwped-preset:hover:not(.hwped-preset-active) {\n background: var(--_hwped-hover);\n}\n\n.hwped-preset:active {\n transform: scale(0.97);\n}\n\n.hwped-preset-active {\n border-color: var(--hwped-accent);\n background: color-mix(in srgb, var(--hwped-accent) 12%, var(--hwped-bg));\n color: var(--hwped-accent);\n font-weight: 600;\n}\n\n.hwped-dialog-actions {\n justify-content: flex-end;\n padding-top: 4px;\n}\n\n@keyframes hwped-fade-in {\n from {\n opacity: 0;\n }\n}\n\n/* Materialize, don't just fade: the surface arrives with a slight scale. */\n@keyframes hwped-materialize {\n from {\n opacity: 0;\n transform: scale(0.98);\n }\n}\n\n/* ---- accessibility preferences ---- */\n\n@media (prefers-reduced-motion: reduce) {\n .hwped *,\n .hwped *::before,\n .hwped *::after {\n transition-duration: 0ms !important;\n }\n\n .hwped-btn:active:not(:disabled),\n .hwped-tab:active,\n .hwped-preset:active {\n transform: none;\n }\n\n .hwped-overlay,\n .hwped-dialog {\n animation: none;\n }\n}\n\n@media (prefers-reduced-transparency: reduce) {\n .hwped-overlay {\n background: rgba(0, 0, 0, 0.55);\n backdrop-filter: none;\n -webkit-backdrop-filter: none;\n }\n}\n\n@media (prefers-contrast: more) {\n .hwped {\n --_hwped-hairline: var(--hwped-fg);\n }\n\n .hwped-btn,\n .hwped-input,\n .hwped-textarea,\n .hwped-preset,\n .hwped-grid td {\n border-color: var(--hwped-fg);\n }\n\n .hwped-tabs {\n box-shadow: inset 0 0 0 1px var(--hwped-fg);\n }\n}\n\n/* A band estimated from Markdown length: the host published no row geometry. */\n.hwped-band-approximate {\n border-style: dashed;\n}\n"],"mappings":";AAkBA,CAAC;AACC,cAAY;AACZ,cAAY;AACZ,iBAAe;AACf,kBAAgB;AAChB,kBAAgB;AAChB,iBAAe;AACf,mBAAiB;AACjB,mBAAiB;AACjB,kBAAgB;AAChB;AAAA,IACE,YAAY;AAAA,IAAE,qBAAqB;AAAA,IAAE,eAAe;AAAA,IAAE,wBAAO;AAAA,IAC7D,aAAa;AAAA,IAAE,UAAU;AAAA,I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ACX;AACF;AAGA,WA5Da;AA6DX;AACE,aAAS;AACT,eAAW,MAAM;AACnB;AACF;AAIA,QAAO,wBAAyB;AAC9B,GAxpBD,MAwpBQ;AAAA,EACP,CAzpBD,MAypBQ,CAAC;AAAA,EACR,CA1pBD,MA0pBQ,CAAC;AACN,yBAAqB;AACvB;AAEA,GA9iBD,SA8iBW,OAAO,KAAK;AAAA,EACtB,CAhbD,SAgbW;AAAA,EACV,CAhbD,YAgbc;AACX,eAAW;AACb;AAEA,GA9GD;AAAA,EA+GC,CAlGD;AAmGG,eAAW;AACb;AACF;AAEA,QAAO,8BAA+B;AACpC,GArHD;AAsHG,gBAAY,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAC1B,qBAAiB;AACjB,6BAAyB;AAC3B;AACF;AAEA,QAAO,kBAAmB;AACxB,GAnrBD;AAorBG,uBAAmB,IAAI;AACzB;AAEA,GAvkBD;AAAA,EAwkBC,CA5eD;AAAA,EA6eC,CA5eD;AAAA,EA6eC,CA1cD;AAAA,EA2cC,CApMD,WAoMa;AACV,kBAAc,IAAI;AACpB;AAEA,GAnZD;AAoZG,gBAAY,MAAM,EAAE,EAAE,EAAE,IAAI,IAAI;AAClC;AACF;AAGA,CAAC;AACC,gBAAc;AAChB;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -509,6 +509,7 @@ declare const en: {
|
|
|
509
509
|
"error.staleReplacement": string;
|
|
510
510
|
"error.staleCompose": string;
|
|
511
511
|
"error.stalePreview": string;
|
|
512
|
+
"error.outputValidation": string;
|
|
512
513
|
"error.unmatchedReplace": string;
|
|
513
514
|
"error.unresolvableAddress": string;
|
|
514
515
|
"error.runRangeConflict": string;
|
|
@@ -760,7 +761,7 @@ interface HwpEditorHandle {
|
|
|
760
761
|
declare const HwpEditor: react.ForwardRefExoticComponent<HwpEditorProps & react.RefAttributes<HwpEditorHandle>>;
|
|
761
762
|
|
|
762
763
|
/**
|
|
763
|
-
* Multi-page scroll of rendered pages.
|
|
764
|
+
* Multi-page scroll of rendered pages. Every page renders as an image;
|
|
764
765
|
* raster formats fall back to <img>. Clicks resolve to the nearest segment
|
|
765
766
|
* (using layout rows, with a flow-model fallback for older hosts), and selected/pending
|
|
766
767
|
* segments are highlighted with overlay bands.
|
package/dist/index.d.ts
CHANGED
|
@@ -509,6 +509,7 @@ declare const en: {
|
|
|
509
509
|
"error.staleReplacement": string;
|
|
510
510
|
"error.staleCompose": string;
|
|
511
511
|
"error.stalePreview": string;
|
|
512
|
+
"error.outputValidation": string;
|
|
512
513
|
"error.unmatchedReplace": string;
|
|
513
514
|
"error.unresolvableAddress": string;
|
|
514
515
|
"error.runRangeConflict": string;
|
|
@@ -760,7 +761,7 @@ interface HwpEditorHandle {
|
|
|
760
761
|
declare const HwpEditor: react.ForwardRefExoticComponent<HwpEditorProps & react.RefAttributes<HwpEditorHandle>>;
|
|
761
762
|
|
|
762
763
|
/**
|
|
763
|
-
* Multi-page scroll of rendered pages.
|
|
764
|
+
* Multi-page scroll of rendered pages. Every page renders as an image;
|
|
764
765
|
* raster formats fall back to <img>. Clicks resolve to the nearest segment
|
|
765
766
|
* (using layout rows, with a flow-model fallback for older hosts), and selected/pending
|
|
766
767
|
* segments are highlighted with overlay bands.
|
package/dist/index.js
CHANGED
|
@@ -26,10 +26,10 @@ function useHwpEditorContext() {
|
|
|
26
26
|
|
|
27
27
|
// src/PageCanvas.tsx
|
|
28
28
|
import { useMemo } from "react";
|
|
29
|
-
import { base64, segmentAtRef, segmentText, selectionAction } from "@hwp-editor/core";
|
|
29
|
+
import { base64, segmentAtRef, segmentText as segmentText2, selectionAction } from "@hwp-editor/core";
|
|
30
30
|
|
|
31
31
|
// src/geometry.ts
|
|
32
|
-
import { segmentAtOffset, markdownLength } from "@hwp-editor/core";
|
|
32
|
+
import { segmentAtOffset, markdownLength, segmentIdPath } from "@hwp-editor/core";
|
|
33
33
|
function clamp(value, min, max) {
|
|
34
34
|
return Math.min(max, Math.max(min, value));
|
|
35
35
|
}
|
|
@@ -81,21 +81,46 @@ function idIndex(envelope) {
|
|
|
81
81
|
idIndexes.set(envelope, index);
|
|
82
82
|
return index;
|
|
83
83
|
}
|
|
84
|
+
var pathIndexes = /* @__PURE__ */ new WeakMap();
|
|
85
|
+
function pathIndex(envelope) {
|
|
86
|
+
const cached = pathIndexes.get(envelope);
|
|
87
|
+
if (cached !== void 0) return cached;
|
|
88
|
+
const index = /* @__PURE__ */ new Map();
|
|
89
|
+
for (const segment of envelope.segments) {
|
|
90
|
+
if (segment.id !== void 0 || segment.kind !== "para") continue;
|
|
91
|
+
const key = [segment.section, ...segment.indices ?? [segment.para]].join(".");
|
|
92
|
+
if (!index.has(key)) index.set(key, segment);
|
|
93
|
+
}
|
|
94
|
+
pathIndexes.set(envelope, index);
|
|
95
|
+
return index;
|
|
96
|
+
}
|
|
97
|
+
function rowSegment(envelope, rowId) {
|
|
98
|
+
const byId = idIndex(envelope).get(rowId);
|
|
99
|
+
if (byId !== void 0) return byId;
|
|
100
|
+
const path = segmentIdPath(rowId);
|
|
101
|
+
return path.length === 0 ? void 0 : pathIndex(envelope).get(path.join("."));
|
|
102
|
+
}
|
|
103
|
+
function hasIds(envelope) {
|
|
104
|
+
return envelope.segments.some((segment) => segment.id !== void 0);
|
|
105
|
+
}
|
|
106
|
+
function rowDraws(envelope, rowId, segment) {
|
|
107
|
+
if (segment.id !== void 0) return rowId === segment.id;
|
|
108
|
+
return rowSegment(envelope, rowId) === segment;
|
|
109
|
+
}
|
|
84
110
|
function segmentOnPage(envelope, page, xFraction, yFraction, pageIndex, pageCount) {
|
|
85
|
-
if (page.layout === void 0 || !envelope.
|
|
111
|
+
if (page.layout === void 0 || !hasIds(envelope) && page.layout.rows.every((row) => rowSegment(envelope, row.id) === void 0)) {
|
|
86
112
|
return nearestSegment(envelope, pageIndex, yFraction, pageCount);
|
|
87
113
|
}
|
|
88
114
|
const { width_pt, height_pt, rows } = page.layout;
|
|
89
115
|
const x = clamp(xFraction, 0, 1) * width_pt;
|
|
90
116
|
const y = clamp(yFraction, 0, 1) * height_pt;
|
|
91
|
-
const byId = idIndex(envelope);
|
|
92
117
|
let best;
|
|
93
118
|
let bestVertical = Infinity;
|
|
94
119
|
let bestHorizontal = Infinity;
|
|
95
120
|
let bestArea = Infinity;
|
|
96
121
|
for (const row of rows) {
|
|
97
122
|
const box = row.box;
|
|
98
|
-
const segment =
|
|
123
|
+
const segment = rowSegment(envelope, row.id);
|
|
99
124
|
if (box === null || segment === void 0) continue;
|
|
100
125
|
const dx = Math.max(box.x0 - x, 0, x - box.x1);
|
|
101
126
|
const dy = Math.max(box.y0 - y, 0, y - box.y1);
|
|
@@ -112,13 +137,13 @@ function segmentOnPage(envelope, page, xFraction, yFraction, pageIndex, pageCoun
|
|
|
112
137
|
return best;
|
|
113
138
|
}
|
|
114
139
|
function bandsOnPage(envelope, segment, page, pageIndex, pageCount) {
|
|
115
|
-
if (page.layout === void 0
|
|
140
|
+
if (page.layout === void 0) {
|
|
116
141
|
const band = segmentBand(envelope, segment, pageCount);
|
|
117
|
-
return band?.pageIndex === pageIndex ? [{ left: 0, top: band.top, width: 100, height: band.height }] : [];
|
|
142
|
+
return band?.pageIndex === pageIndex ? [{ left: 0, top: band.top, width: 100, height: band.height, approximate: true }] : [];
|
|
118
143
|
}
|
|
119
144
|
const target = ["run", "image", "field"].includes(segment.kind) && segment.indices !== void 0 ? envelope.segments.find((candidate) => candidate.kind === "para" && candidate.section === segment.section && candidate.indices !== void 0 && candidate.indices.length === segment.indices.length - 1 && candidate.indices.every((value, index) => value === segment.indices[index])) ?? segment : segment;
|
|
120
145
|
const { width_pt, height_pt, rows } = page.layout;
|
|
121
|
-
return rows.filter((row) => row.
|
|
146
|
+
return rows.filter((row) => row.box !== null && rowDraws(envelope, row.id, target)).map((row) => {
|
|
122
147
|
const box = row.box;
|
|
123
148
|
return {
|
|
124
149
|
left: box.x0 / width_pt * 100,
|
|
@@ -130,6 +155,7 @@ function bandsOnPage(envelope, segment, page, pageIndex, pageCount) {
|
|
|
130
155
|
}
|
|
131
156
|
|
|
132
157
|
// src/text.ts
|
|
158
|
+
import { segmentIdPath as segmentIdPath2, segmentText } from "@hwp-editor/core";
|
|
133
159
|
function plainSegmentText(markdownSlice) {
|
|
134
160
|
return markdownSlice.split("\n").map(stripLine).join("\n").trim();
|
|
135
161
|
}
|
|
@@ -143,6 +169,41 @@ function stripLine(line) {
|
|
|
143
169
|
out = out.replace(/`([^`]*)`/g, "$1");
|
|
144
170
|
return out;
|
|
145
171
|
}
|
|
172
|
+
var LIST_MARKER = /^[ \t]*(?:\d{1,9}[.)]|[-*+])[ \t]+/;
|
|
173
|
+
function paragraphSourceText(envelope, para, pages = []) {
|
|
174
|
+
const plain = plainSegmentText(segmentText(envelope, para));
|
|
175
|
+
const marker = LIST_MARKER.exec(plain);
|
|
176
|
+
if (marker === null) return plain;
|
|
177
|
+
const stripped = plain.slice(marker[0].length);
|
|
178
|
+
if (para.indices !== void 0) {
|
|
179
|
+
const first = envelope.segments.find((candidate) => candidate.kind === "run" && candidate.section === para.section && candidate.indices !== void 0 && candidate.indices.length === para.indices.length + 1 && para.indices.every((value, index) => candidate.indices[index] === value));
|
|
180
|
+
if (first !== void 0) {
|
|
181
|
+
const lead = [...segmentText(envelope, para)].slice(0, Math.max(0, first.start - para.start)).join("");
|
|
182
|
+
return LIST_MARKER.test(lead) && lead.trim() === marker[0].trim() ? stripped : plain;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
const length = sourceLength(para, pages);
|
|
186
|
+
if (length === void 0) return plain;
|
|
187
|
+
return stripped.length === length && plain.length !== length ? stripped : plain;
|
|
188
|
+
}
|
|
189
|
+
function sourceLength(para, pages) {
|
|
190
|
+
let start = Infinity;
|
|
191
|
+
let end = -Infinity;
|
|
192
|
+
for (const page of pages) {
|
|
193
|
+
for (const row of page.layout?.rows ?? []) {
|
|
194
|
+
if (row.kind !== "para" || row.source_chars === null || !rowMatches(row.id, para)) continue;
|
|
195
|
+
start = Math.min(start, row.source_chars.start);
|
|
196
|
+
end = Math.max(end, row.source_chars.end);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return end >= start ? end - start : void 0;
|
|
200
|
+
}
|
|
201
|
+
function rowMatches(rowId, segment) {
|
|
202
|
+
if (segment.id !== void 0) return rowId === segment.id;
|
|
203
|
+
const path = segmentIdPath2(rowId);
|
|
204
|
+
const own = [segment.section, ...segment.indices ?? [segment.para]];
|
|
205
|
+
return path.length === own.length && path.every((value, index) => value === own[index]);
|
|
206
|
+
}
|
|
146
207
|
|
|
147
208
|
// src/PageCanvas.tsx
|
|
148
209
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -161,7 +222,7 @@ function PageCanvas() {
|
|
|
161
222
|
if (segment !== void 0) selectedSegments.add(segment);
|
|
162
223
|
}
|
|
163
224
|
}
|
|
164
|
-
if (pages.length === 0) {
|
|
225
|
+
if (pages.length === 0 || envelope === null) {
|
|
165
226
|
return /* @__PURE__ */ jsx("div", { className: "hwped-canvas", role: "main", "aria-label": t("canvas.aria"), children: /* @__PURE__ */ jsx("div", { className: "hwped-empty", children: t("canvas.emptyPages") }) });
|
|
166
227
|
}
|
|
167
228
|
const selectAt = (pageIndex, xFraction, yFraction, modifiers) => {
|
|
@@ -215,7 +276,7 @@ function bandsForPage(envelope, page, pageIndex, pageCount, selected, pendingKey
|
|
|
215
276
|
bands.push({
|
|
216
277
|
...band,
|
|
217
278
|
key: `${isSelected ? "sel" : "pend"}-${key}-${bandIdentity(segment)}-${index}`,
|
|
218
|
-
className: isSelected ? "hwped-band hwped-band-selected" : "hwped-band hwped-band-pending"
|
|
279
|
+
className: (isSelected ? "hwped-band hwped-band-selected" : "hwped-band hwped-band-pending") + (band.approximate ? " hwped-band-approximate" : "")
|
|
219
280
|
});
|
|
220
281
|
}
|
|
221
282
|
}
|
|
@@ -259,6 +320,7 @@ function PageView(props) {
|
|
|
259
320
|
"div",
|
|
260
321
|
{
|
|
261
322
|
className: band.className,
|
|
323
|
+
"data-approximate": band.className.includes("hwped-band-approximate") ? "true" : void 0,
|
|
262
324
|
style: { top: `${band.top}%`, height: `${band.height}%`, left: `${band.left}%`, width: `${band.width}%` }
|
|
263
325
|
},
|
|
264
326
|
band.key
|
|
@@ -291,7 +353,7 @@ function targetsSegment(op, envelope, segment) {
|
|
|
291
353
|
return "run" in at ? segment.kind === "run" && segment.indices?.length === 2 && segment.indices[1] === at.run : segment.kind === "para" && (segment.indices === void 0 || segment.indices.length === 1);
|
|
292
354
|
}
|
|
293
355
|
const target = opSearchText(op);
|
|
294
|
-
return target !== null && target !== "" && plainSegmentText(
|
|
356
|
+
return target !== null && target !== "" && plainSegmentText(segmentText2(envelope, segment)).includes(target);
|
|
295
357
|
}
|
|
296
358
|
|
|
297
359
|
// src/unit-input.ts
|
|
@@ -302,7 +364,7 @@ function isPlainDecimal(value) {
|
|
|
302
364
|
|
|
303
365
|
// src/SegmentInspector.tsx
|
|
304
366
|
import { useEffect, useMemo as useMemo2, useRef, useState } from "react";
|
|
305
|
-
import { compareSegments, documentFormat, formatTargets as collectFormatTargets, hasDirectFormatting, hasOwnRef, isSectionDefinitionParagraph, paragraphAddress, paragraphRuns, resolveSelection, segmentAtRef as segmentAtRef2, segmentIdPath, segmentPath, segmentRef, segmentText as
|
|
367
|
+
import { compareSegments, documentFormat, formatTargets as collectFormatTargets, hasDirectFormatting, hasOwnRef, isSectionDefinitionParagraph, paragraphAddress, paragraphRuns, resolveSelection, segmentAtRef as segmentAtRef2, segmentIdPath as segmentIdPath3, segmentPath, segmentRef, segmentText as segmentText3, selectSimilar, selectedParagraphs, selectionAction as selectionAction2, stylesVersionSupported } from "@hwp-editor/core";
|
|
306
368
|
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
307
369
|
var ALIGNMENTS = [
|
|
308
370
|
{ value: "left", key: "segment.alignLeft" },
|
|
@@ -353,8 +415,8 @@ function SegmentInspector() {
|
|
|
353
415
|
const clickRefusedText = (reason) => reason === null || reason === void 0 ? null : t(CLICK_REFUSAL_MESSAGE[reason]);
|
|
354
416
|
const refusalReason2 = refusalText(targets?.refusal);
|
|
355
417
|
const targetLabel = segment === void 0 ? "" : segment.kind === "cell" ? t("segment.selectedCell", { path: segmentPath(segment), count: paragraphTargets.length }) : singleParagraph === void 0 ? "" : t("segment.selectedPara", { path: segmentPath(singleParagraph) });
|
|
356
|
-
const currentText = envelope !== null && paragraphTargets.length > 0 ?
|
|
357
|
-
const markdownText = envelope !== null && singleParagraph !== void 0 ?
|
|
418
|
+
const currentText = envelope !== null && paragraphTargets.length > 0 ? paragraphTargets.map((candidate) => paragraphSourceText(envelope, candidate, state.pages)).join("\n").trim() : "";
|
|
419
|
+
const markdownText = envelope !== null && singleParagraph !== void 0 ? segmentText3(envelope, singleParagraph) : "";
|
|
358
420
|
const supplementaryStarts = useMemo2(() => {
|
|
359
421
|
const positions = [];
|
|
360
422
|
let offset = 0;
|
|
@@ -413,7 +475,7 @@ function SegmentInspector() {
|
|
|
413
475
|
if (insertionRun === null || !insertionCurrent || runParent === void 0) return [];
|
|
414
476
|
const section = insertionRun[0].section;
|
|
415
477
|
return insertedHidden.ids.flatMap((id) => {
|
|
416
|
-
const [idSection, ...indices] =
|
|
478
|
+
const [idSection, ...indices] = segmentIdPath3(id);
|
|
417
479
|
if (idSection !== section || indices.length !== runParent.length + 1) return [];
|
|
418
480
|
if (!runParent.every((index, at) => indices[at] === index)) return [];
|
|
419
481
|
return [{ id, index: indices[indices.length - 1] }];
|
|
@@ -620,7 +682,7 @@ function SegmentInspector() {
|
|
|
620
682
|
style: { maxHeight: "12rem", overflowY: "auto" },
|
|
621
683
|
children: paragraphs.map((candidate, index) => {
|
|
622
684
|
const isSelected = selected.some((item) => item === candidate || item.id !== void 0 && item.id === candidate.id || item.id === void 0 && candidate.id === void 0 && item.section === candidate.section && item.para === candidate.para);
|
|
623
|
-
const snippet = plainSegmentText(
|
|
685
|
+
const snippet = plainSegmentText(segmentText3(envelope, candidate)).trim().replace(/\s+/g, " ");
|
|
624
686
|
const text = snippet.length > 96 ? `${snippet.slice(0, 93)}...` : snippet || t("segment.emptyPara");
|
|
625
687
|
const label = t("segment.choiceLabel", { index: index + 1, text });
|
|
626
688
|
return /* @__PURE__ */ jsx2(
|
|
@@ -1517,7 +1579,7 @@ import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
|
1517
1579
|
import { tableCountMismatch } from "@hwp-editor/core";
|
|
1518
1580
|
|
|
1519
1581
|
// src/tables.ts
|
|
1520
|
-
import { segmentText as
|
|
1582
|
+
import { segmentText as segmentText4 } from "@hwp-editor/core";
|
|
1521
1583
|
var GFM_DELIMITER_CELL = /^:?-{2,}:?$/;
|
|
1522
1584
|
function endsWithCellDelimiter(row) {
|
|
1523
1585
|
if (!row.endsWith("|")) return false;
|
|
@@ -1584,7 +1646,7 @@ function findTables(envelope) {
|
|
|
1584
1646
|
tables.push({
|
|
1585
1647
|
tableIndex: tables.length,
|
|
1586
1648
|
segment,
|
|
1587
|
-
rows: parseMarkdownTable(
|
|
1649
|
+
rows: parseMarkdownTable(segmentText4(envelope, segment))
|
|
1588
1650
|
});
|
|
1589
1651
|
}
|
|
1590
1652
|
return tables;
|
|
@@ -1889,7 +1951,7 @@ function TableGrid() {
|
|
|
1889
1951
|
|
|
1890
1952
|
// src/FieldsPanel.tsx
|
|
1891
1953
|
import { useMemo as useMemo3, useState as useState4 } from "react";
|
|
1892
|
-
import { segmentAtRef as segmentAtRef4, segmentText as
|
|
1954
|
+
import { segmentAtRef as segmentAtRef4, segmentText as segmentText5 } from "@hwp-editor/core";
|
|
1893
1955
|
|
|
1894
1956
|
// src/fields.ts
|
|
1895
1957
|
import { resolveSelection as resolveSelection3, segmentRef as segmentRef3 } from "@hwp-editor/core";
|
|
@@ -1958,7 +2020,7 @@ function FieldsPanel() {
|
|
|
1958
2020
|
legacy && /* @__PURE__ */ jsx5("p", { className: "hwped-hint", children: t("fields.legacySeparatorHint") }),
|
|
1959
2021
|
slots.length === 0 ? /* @__PURE__ */ jsx5("p", { className: "hwped-hint", children: t("fields.hint") }) : /* @__PURE__ */ jsx5("ul", { className: "hwped-fields", children: slots.map((slot) => {
|
|
1960
2022
|
const segment = envelope === null ? void 0 : segmentAtRef4(envelope, slot.segment);
|
|
1961
|
-
const snippet = envelope === null || segment === void 0 ? "" :
|
|
2023
|
+
const snippet = envelope === null || segment === void 0 ? "" : segmentText5(envelope, segment).trim().slice(0, 40);
|
|
1962
2024
|
const draft = drafts[slot.name] ?? "";
|
|
1963
2025
|
return /* @__PURE__ */ jsxs5("li", { className: "hwped-field-item", children: [
|
|
1964
2026
|
/* @__PURE__ */ jsx5("div", { className: "hwped-row", children: /* @__PURE__ */ jsx5(
|
|
@@ -2901,11 +2963,13 @@ function isLayoutOverflow(error) {
|
|
|
2901
2963
|
function wrapped(error, text, detail) {
|
|
2902
2964
|
if (isHwpEngineError2(error)) {
|
|
2903
2965
|
const insertion = insertionOf(error);
|
|
2966
|
+
const refusal = engineRefusalKind(error);
|
|
2904
2967
|
return Object.assign(
|
|
2905
2968
|
new HwpEngineError2(error.code, text, {
|
|
2906
2969
|
...error.status === void 0 ? {} : { status: error.status },
|
|
2907
2970
|
cause: error,
|
|
2908
2971
|
...insertion === void 0 ? {} : { insertion },
|
|
2972
|
+
...refusal === void 0 ? {} : { refusal },
|
|
2909
2973
|
// The marker survives too: a host's `onError` branches on the same
|
|
2910
2974
|
// structured fields the transport set, so a wrapper that drops one
|
|
2911
2975
|
// hands it a failure it cannot classify (#91).
|
|
@@ -2928,6 +2992,9 @@ function isRefusedInsertion(error) {
|
|
|
2928
2992
|
function insertionFailure(error, blocks, t) {
|
|
2929
2993
|
const message = error instanceof Error ? error.message : String(error);
|
|
2930
2994
|
if (!isRefusedInsertion(error)) return error;
|
|
2995
|
+
if (engineRefusalKind(error) === "output_validation") {
|
|
2996
|
+
return wrapped(error, t("error.outputValidation"), message);
|
|
2997
|
+
}
|
|
2931
2998
|
const insertion = insertionOf(error);
|
|
2932
2999
|
if (insertion?.kind === "unknown_style") {
|
|
2933
3000
|
return wrapped(error, t("components.unknownStyle", { style: insertion.style }), message);
|
|
@@ -3952,6 +4019,7 @@ var en = {
|
|
|
3952
4019
|
"error.staleReplacement": "The document changed during template work; reopen it and try again.",
|
|
3953
4020
|
"error.staleCompose": "The open document changed while the new document was being composed; compose again.",
|
|
3954
4021
|
"error.stalePreview": "The document changed while this preview was being made; preview again on the open document.",
|
|
4022
|
+
"error.outputValidation": "The engine's output preservation check refused to write the edited file. One known cause is HWPX font metadata (typeInfo) that HWP5 cannot represent. In that case, save as .hwpx to preserve the metadata. If you accept its loss, explicitly run ahwp convert in.hwpx -o in.hwp without --strict, reopen in.hwp, and retry. For other causes, rerun the same edit with the engine's --verify option and inspect the verification report.",
|
|
3955
4023
|
"error.unmatchedReplace": "The engine found no text to replace in that paragraph, so nothing was applied. Select the text again and retry.",
|
|
3956
4024
|
"error.unresolvableAddress": "The engine could not address the edit's paragraph or run. Runs inside some nested paragraphs cannot be addressed. Format text in a top-level paragraph or a table cell, or edit this target in a word processor.",
|
|
3957
4025
|
"error.runRangeConflict": "A run format change was refused because an earlier pending change in that paragraph (text, a link, a field, a bookmark, an image or a cell) may change its text, so the run might no longer name the same characters. Nothing was applied. Remove the format change from the pending list, apply the rest, then format the run again; or queue the format change before the others.",
|
|
@@ -4410,6 +4478,7 @@ var ko = {
|
|
|
4410
4478
|
"error.staleReplacement": "\uD15C\uD50C\uB9BF \uC791\uC5C5 \uC911 \uBB38\uC11C\uAC00 \uBC14\uB00C\uC5C8\uC2B5\uB2C8\uB2E4. \uBB38\uC11C\uB97C \uB2E4\uC2DC \uC5F0 \uB4A4 \uC7AC\uC2DC\uB3C4\uD558\uC138\uC694.",
|
|
4411
4479
|
"error.staleCompose": "\uC0C8 \uBB38\uC11C\uB97C \uC791\uC131\uD558\uB294 \uB3D9\uC548 \uC5F4\uB9B0 \uBB38\uC11C\uAC00 \uBC14\uB00C\uC5C8\uC2B5\uB2C8\uB2E4. \uB2E4\uC2DC \uC791\uC131\uD558\uC138\uC694.",
|
|
4412
4480
|
"error.stalePreview": "\uBBF8\uB9AC\uBCF4\uAE30\uB97C \uB9CC\uB4DC\uB294 \uB3D9\uC548 \uBB38\uC11C\uAC00 \uBC14\uB00C\uC5C8\uC2B5\uB2C8\uB2E4. \uC5F4\uB9B0 \uBB38\uC11C\uC5D0\uC11C \uB2E4\uC2DC \uBBF8\uB9AC\uBCF4\uAE30\uD558\uC138\uC694.",
|
|
4481
|
+
"error.outputValidation": "\uC5D4\uC9C4\uC758 \uCD9C\uB825 \uBCF4\uC874 \uAC80\uC0AC\uC5D0\uC11C \uD3B8\uC9D1 \uACB0\uACFC \uD30C\uC77C \uC4F0\uAE30\uB97C \uAC70\uBD80\uD588\uC2B5\uB2C8\uB2E4. \uC54C\uB824\uC9C4 \uC6D0\uC778 \uC911 \uD558\uB098\uB294 HWP5\uB85C \uD45C\uD604\uD560 \uC218 \uC5C6\uB294 HWPX \uAE00\uAF34 \uBA54\uD0C0\uB370\uC774\uD130(typeInfo)\uC785\uB2C8\uB2E4. \uC774 \uACBD\uC6B0 \uBA54\uD0C0\uB370\uC774\uD130\uB97C \uBCF4\uC874\uD558\uB824\uBA74 .hwpx\uB85C \uC800\uC7A5\uD558\uC138\uC694. \uBA54\uD0C0\uB370\uC774\uD130 \uC190\uC2E4\uC744 \uC218\uC6A9\uD55C\uB2E4\uBA74 ahwp convert in.hwpx -o in.hwp\uB97C --strict \uC5C6\uC774 \uBA85\uC2DC\uC801\uC73C\uB85C \uC2E4\uD589\uD558\uACE0, in.hwp\uB97C \uB2E4\uC2DC \uC5F0 \uB4A4 \uC7AC\uC2DC\uB3C4\uD558\uC138\uC694. \uB2E4\uB978 \uC6D0\uC778\uC774\uBA74 \uAC19\uC740 \uD3B8\uC9D1\uC744 \uC5D4\uC9C4\uC758 --verify \uC635\uC158\uACFC \uD568\uAED8 \uB2E4\uC2DC \uC2E4\uD589\uD558\uACE0 \uAC80\uC99D \uBCF4\uACE0\uC11C\uB97C \uD655\uC778\uD558\uC138\uC694.",
|
|
4413
4482
|
"error.unmatchedReplace": "\uD574\uB2F9 \uBB38\uB2E8\uC5D0\uC11C \uBC14\uAFC0 \uD14D\uC2A4\uD2B8\uB97C \uC5D4\uC9C4\uC774 \uCC3E\uC9C0 \uBABB\uD574 \uC544\uBB34\uAC83\uB3C4 \uC801\uC6A9\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. \uD14D\uC2A4\uD2B8\uB97C \uB2E4\uC2DC \uC120\uD0DD\uD55C \uB4A4 \uC7AC\uC2DC\uB3C4\uD558\uC138\uC694.",
|
|
4414
4483
|
"error.unresolvableAddress": "\uC5D4\uC9C4\uC774 \uD3B8\uC9D1 \uB300\uC0C1 \uBB38\uB2E8\uC774\uB098 run\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC77C\uBD80 \uC911\uCCA9 \uBB38\uB2E8 \uC548\uC758 run\uC740 \uC5D4\uC9C4\uC774 \uC8FC\uC18C\uB85C \uC9C0\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD5C\uC0C1\uC704 \uBB38\uB2E8\uC774\uB098 \uD45C \uC140\uC758 \uD14D\uC2A4\uD2B8\uC5D0 \uC11C\uC2DD\uC744 \uC9C0\uC815\uD558\uAC70\uB098, \uC774 \uB300\uC0C1\uC740 \uC6CC\uB4DC\uD504\uB85C\uC138\uC11C\uC5D0\uC11C \uD3B8\uC9D1\uD558\uC138\uC694.",
|
|
4415
4484
|
"error.runRangeConflict": "\uAC19\uC740 \uBB38\uB2E8\uC5D0 \uB300\uAE30 \uC911\uC778 \uC55E\uC120 \uBCC0\uACBD(\uD14D\uC2A4\uD2B8, \uB9C1\uD06C, \uD544\uB4DC, \uCC45\uAC08\uD53C, \uC774\uBBF8\uC9C0, \uC140)\uC774 \uBB38\uB2E8 \uD14D\uC2A4\uD2B8\uB97C \uBC14\uAFC0 \uC218 \uC788\uC5B4 run\uC774 \uB354 \uC774\uC0C1 \uAC19\uC740 \uAE00\uC790\uB97C \uAC00\uB9AC\uD0A4\uC9C0 \uC54A\uC744 \uC218 \uC788\uC73C\uBBC0\uB85C run \uC11C\uC2DD \uBCC0\uACBD\uC774 \uAC70\uBD80\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC544\uBB34\uAC83\uB3C4 \uC801\uC6A9\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. \uB300\uAE30 \uBAA9\uB85D\uC5D0\uC11C \uC11C\uC2DD \uBCC0\uACBD\uC744 \uC81C\uAC70\uD558\uACE0 \uB098\uBA38\uC9C0\uB97C \uC801\uC6A9\uD55C \uB4A4 run \uC11C\uC2DD\uC744 \uB2E4\uC2DC \uC9C0\uC815\uD558\uAC70\uB098, \uC11C\uC2DD \uBCC0\uACBD\uC744 \uB2E4\uB978 \uBCC0\uACBD\uBCF4\uB2E4 \uBA3C\uC800 \uB300\uAE30\uC5F4\uC5D0 \uB123\uC73C\uC138\uC694.",
|
|
@@ -4590,7 +4659,8 @@ var REFUSAL_MESSAGE = {
|
|
|
4590
4659
|
unmatched_replace: "error.unmatchedReplace",
|
|
4591
4660
|
run_range_conflict: "error.runRangeConflict",
|
|
4592
4661
|
range_tag: "error.rangeTagRefused",
|
|
4593
|
-
unresolvable_address: "error.unresolvableAddress"
|
|
4662
|
+
unresolvable_address: "error.unresolvableAddress",
|
|
4663
|
+
output_validation: "error.outputValidation"
|
|
4594
4664
|
};
|
|
4595
4665
|
var HwpEditor = forwardRef(
|
|
4596
4666
|
function HwpEditor2(props, ref) {
|