claude-artifact-framework 0.5.1 → 0.5.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/README.md CHANGED
@@ -12,7 +12,7 @@ mirrors npm packages automatically.
12
12
  ### As a global script (`<script>` tag)
13
13
 
14
14
  ```html
15
- <script src="https://cdn.jsdelivr.net/npm/claude-artifact-framework@0.5.1/dist/index.global.js"></script>
15
+ <script src="https://cdn.jsdelivr.net/npm/claude-artifact-framework@0.5.2/dist/index.global.js"></script>
16
16
  <script>
17
17
  const { storage, createStore, createPersistedStore, createSharedStore } = ArtifactKit;
18
18
  </script>
@@ -27,11 +27,11 @@ mirrors npm packages automatically.
27
27
  createStore,
28
28
  createPersistedStore,
29
29
  createSharedStore,
30
- } from "https://cdn.jsdelivr.net/npm/claude-artifact-framework@0.5.1/dist/index.esm.js";
30
+ } from "https://cdn.jsdelivr.net/npm/claude-artifact-framework@0.5.2/dist/index.esm.js";
31
31
  </script>
32
32
  ```
33
33
 
34
- Pin a version (`@0.5.1`) for reproducible artifacts, or drop the version
34
+ Pin a version (`@0.5.2`) for reproducible artifacts, or drop the version
35
35
  (`claude-artifact-framework/dist/...`) to always get the latest release.
36
36
 
37
37
  ### Inside a React artifact
package/dist/index.esm.js CHANGED
@@ -1141,23 +1141,33 @@ Continue with this information. If you have everything you need, answer in natur
1141
1141
  busy && live === null ? createElement("div", { className: "caf-msg-tools" }, "thinking\u2026") : null,
1142
1142
  createElement("div", { ref: endRef })
1143
1143
  ),
1144
+ // Deliberately NOT a <form>: the artifact iframe's sandbox lacks
1145
+ // allow-forms, so native form submission is blocked there — and on mobile
1146
+ // the keyboard's send key triggers exactly that implicit submission. A
1147
+ // plain div with onClick + Enter via onKeyDown never touches the native
1148
+ // form machinery, so it can't be sandboxed away.
1144
1149
  createElement(
1145
- "form",
1146
- {
1147
- className: "caf-chat-input",
1148
- onSubmit: (e) => {
1149
- e.preventDefault();
1150
- send();
1151
- }
1152
- },
1150
+ "div",
1151
+ { className: "caf-chat-input" },
1153
1152
  createElement("input", {
1154
1153
  value: draft,
1155
1154
  placeholder: c.placeholder || "Message\u2026",
1156
1155
  disabled: busy,
1156
+ enterKeyHint: "send",
1157
1157
  onChange: (e) => setDraft(e.target.value),
1158
+ onKeyDown: (e) => {
1159
+ if (e.key === "Enter") {
1160
+ e.preventDefault();
1161
+ send();
1162
+ }
1163
+ },
1158
1164
  "aria-label": "Message"
1159
1165
  }),
1160
- createElement("button", { type: "submit", className: "caf-btn caf-btn-primary", disabled: busy || !draft.trim() }, "Send")
1166
+ createElement(
1167
+ "button",
1168
+ { type: "button", className: "caf-btn caf-btn-primary", disabled: busy || !draft.trim(), onClick: send },
1169
+ "Send"
1170
+ )
1161
1171
  )
1162
1172
  );
1163
1173
  }