@wipco/sdui-editor 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -155,7 +155,12 @@ declare class PageIdRejectedError extends Error {
155
155
  readonly id: string;
156
156
  constructor(id: string, detail: string);
157
157
  }
158
- /** 페이지 id 규칙: [A-Za-z0-9_-] 세그먼트를 /로 연결. 경로 탈출을 원천 차단한다. */
158
+ /**
159
+ * 페이지 id 규칙: [A-Za-z0-9_-] 세그먼트 또는 `{name}` 패턴 세그먼트를 /로 연결.
160
+ * 경로 탈출을 원천 차단한다. `{name}` 은 sdui-server 0.3.0 의 동적 상세 라우트
161
+ * 문법이다 — 이 패턴이 몰라서 편집기 목록·편집 진입에서 패턴 스펙이 통째로
162
+ * 사라졌던 적이 있다(실측: pages-index 에는 오는데 목록 필터가 걸러냄).
163
+ */
159
164
  declare const PAGE_ID_PATTERN: RegExp;
160
165
  declare function isValidPageId(id: string): boolean;
161
166
  /** 스펙에서 표시용 제목 뽑기 — 모든 어댑터가 같은 규칙을 써야 목록이 갈리지 않는다 */
package/dist/index.js CHANGED
@@ -73,7 +73,7 @@ var PageIdRejectedError = class extends Error {
73
73
  }
74
74
  id;
75
75
  };
76
- var PAGE_ID_PATTERN = /^[A-Za-z0-9_-]+(\/[A-Za-z0-9_-]+)*$/;
76
+ var PAGE_ID_PATTERN = /^([A-Za-z0-9_-]+|\{[A-Za-z0-9_]+\})(\/([A-Za-z0-9_-]+|\{[A-Za-z0-9_]+\}))*$/;
77
77
  function isValidPageId(id) {
78
78
  return PAGE_ID_PATTERN.test(id) && id.length <= 200;
79
79
  }
@@ -695,6 +695,7 @@ var ACTIONS = [
695
695
  ["open / close", "key \u2014 \uC0C1\uD0DC\uB97C true/false\uB85C (Show+Dialog \uC870\uD569)"],
696
696
  ["toast", "tone\xB7title\xB7message \u2014 \uC6B0\uD558\uB2E8 \uC54C\uB9BC 4\uCD08"],
697
697
  ["submitForm", "form, endpoint, method?, onSuccess?, onError? \u2014 \uAC80\uC99D \uD6C4 \uC804\uC1A1"],
698
+ ["request", "endpoint, method?, body?, invalidate?, onSuccess?, onError? \u2014 \uD3FC \uC218\uC9D1 \uC5C6\uC774 \uC694\uCCAD"],
698
699
  ["arrayAppend/Remove/Move/Update", "key(+value/index/from\xB7to/field) \u2014 \uBC18\uBCF5 \uD589 \uD3B8\uC9D1"],
699
700
  ["download", "endpoint, filename? \u2014 \uD30C\uC77C \uC800\uC7A5"],
700
701
  ["refresh / invalidate", "\uC5B4\uB311\uD130 \uC704\uC784 \u2014 \uC7AC\uC870\uD68C"],
@@ -3951,6 +3952,29 @@ var VERBS = [
3951
3952
  { name: "onError", label: "\uC2E4\uD328 \uC2DC", kind: "actions", hint: "\uC0DD\uB7B5\uD558\uBA74 danger \uD1A0\uC2A4\uD2B8" }
3952
3953
  ]
3953
3954
  },
3955
+ {
3956
+ action: "request",
3957
+ label: "API \uC694\uCCAD",
3958
+ summaryField: "endpoint",
3959
+ fields: [
3960
+ { name: "endpoint", label: "endpoint", kind: "string" },
3961
+ {
3962
+ name: "method",
3963
+ label: "HTTP \uBA54\uC11C\uB4DC",
3964
+ kind: "enum",
3965
+ options: [
3966
+ { value: "POST", label: "POST" },
3967
+ { value: "PUT", label: "PUT" },
3968
+ { value: "PATCH", label: "PATCH" },
3969
+ { value: "DELETE", label: "DELETE" }
3970
+ ]
3971
+ },
3972
+ { name: "body", label: "\uBCF8\uBB38", kind: "json", hint: "\uB9AC\uD130\uB7F4 \uB610\uB294 $state/$calc \uCC38\uC870. \uD3FC \uC218\uC9D1 \uC5C6\uC774 \uC774 \uAC12 \uADF8\uB300\uB85C \uBCF4\uB0B8\uB2E4." },
3973
+ { name: "invalidate", label: "\uBB34\uD6A8\uD654\uD560 \uD0A4 \uC811\uB450", kind: "string" },
3974
+ { name: "onSuccess", label: "\uC131\uACF5 \uC2DC", kind: "actions", hint: "\uC774\uBCA4\uD2B8 \uAC12 = \uC751\uB2F5 JSON" },
3975
+ { name: "onError", label: "\uC2E4\uD328 \uC2DC", kind: "actions", hint: "\uC0DD\uB7B5\uD558\uBA74 danger \uD1A0\uC2A4\uD2B8" }
3976
+ ]
3977
+ },
3954
3978
  {
3955
3979
  action: "toast",
3956
3980
  label: "\uC54C\uB9BC \uB744\uC6B0\uAE30",
@@ -7192,6 +7216,21 @@ var ACTION_METAS = [
7192
7216
  { name: "onError", label: "\uC2E4\uD328\uD558\uBA74", kind: "actions", description: "\uBE44\uC6CC \uB450\uBA74 \uC704\uD5D8 \uD1A0\uC2A4\uD2B8\uAC00 \uB72C\uB2E4." }
7193
7217
  ]
7194
7218
  },
7219
+ {
7220
+ action: "request",
7221
+ label: "API \uC694\uCCAD",
7222
+ group: "\uD3FC",
7223
+ seen: 0,
7224
+ description: "\uD3FC \uC218\uC9D1 \uC5C6\uC774 \uBCF8\uBB38\uC744 \uADF8\uB300\uB85C \uBCF4\uB0B8\uB2E4. \uC81C\uCD9C \uC751\uB2F5\uC758 id\uB85C \uD6C4\uC18D \uD638\uCD9C(\uCCA8\uBD80 \uC5F0\uACB0 \uB4F1)\uC744 \uC774\uC744 \uB54C \uC4F4\uB2E4.",
7225
+ fields: [
7226
+ { name: "endpoint", label: "\uC5D4\uB4DC\uD3EC\uC778\uD2B8", kind: "endpoint", required: true },
7227
+ { name: "method", label: "\uBA54\uC11C\uB4DC", kind: "enum", options: METHOD_OPTIONS, placeholder: "POST(\uAE30\uBCF8)" },
7228
+ { name: "body", label: "\uBCF8\uBB38", kind: "value" },
7229
+ { name: "invalidate", label: "\uBB34\uD6A8\uD654\uD560 \uD0A4 \uC811\uB450", kind: "text" },
7230
+ { name: "onSuccess", label: "\uC131\uACF5\uD558\uBA74", kind: "actions", description: "\uC774\uBCA4\uD2B8 \uAC12\uC740 \uC751\uB2F5 JSON\uC774\uB2E4." },
7231
+ { name: "onError", label: "\uC2E4\uD328\uD558\uBA74", kind: "actions", description: "\uBE44\uC6CC \uB450\uBA74 \uC704\uD5D8 \uD1A0\uC2A4\uD2B8\uAC00 \uB72C\uB2E4." }
7232
+ ]
7233
+ },
7195
7234
  {
7196
7235
  action: "arrayUpdate",
7197
7236
  label: "\uBC30\uC5F4 \uD589 \uC218\uC815",
@@ -7408,6 +7447,8 @@ function formatAction(action) {
7408
7447
  const method = raw("method") || "POST";
7409
7448
  return `${raw("form") || "(\uD3FC \uC5C6\uC74C)"} \u2192 ${method} ${raw("endpoint") || "(\uC5D4\uB4DC\uD3EC\uC778\uD2B8 \uC5C6\uC74C)"}`;
7410
7449
  }
7450
+ case "request":
7451
+ return `${raw("method") || "POST"} ${raw("endpoint") || "(\uC5D4\uB4DC\uD3EC\uC778\uD2B8 \uC5C6\uC74C)"}`;
7411
7452
  case "arrayAppend":
7412
7453
  return `${raw("key")}\uC5D0 ${value("value") || "\uBE48 \uAC1D\uCCB4"} \uCD94\uAC00`;
7413
7454
  case "arrayRemove":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipco/sdui-editor",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "SDUI 페이지 스펙 편집기 — 소비 프로젝트가 자기 라우트에 마운트하는 React 컴포넌트",
5
5
  "keywords": [
6
6
  "sdui",
@@ -58,14 +58,14 @@
58
58
  "codemirror": "^6.0.1"
59
59
  },
60
60
  "peerDependencies": {
61
- "@wipco/sdui": "^0.13.0",
61
+ "@wipco/sdui": "^0.14.0",
62
62
  "react": ">=18",
63
63
  "react-dom": ">=18"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@types/react": "^19.0.0",
67
67
  "@types/react-dom": "^19.0.0",
68
- "@wipco/sdui": "^0.13.0",
68
+ "@wipco/sdui": "^0.14.0",
69
69
  "tsup": "^8.5.0",
70
70
  "tsx": "^4.20.0",
71
71
  "typescript": "^5.7.0"