@tscircuit/runframe 0.0.2154 → 0.0.2155

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.
@@ -2012,7 +2012,7 @@ var usePostHogActivity = (properties) => {
2012
2012
  };
2013
2013
 
2014
2014
  // package.json
2015
- var version = "0.0.2153";
2015
+ var version = "0.0.2154";
2016
2016
  var package_default = {
2017
2017
  name: "@tscircuit/runframe",
2018
2018
  main: "dist/preview.js",
@@ -6022,6 +6022,7 @@ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
6022
6022
  import { jsx as jsx41, jsxs as jsxs29 } from "react/jsx-runtime";
6023
6023
  var CRISP_WEBSITE_ID = "24b58135-86c7-4e4b-bf6e-cca862bc4b26";
6024
6024
  var CRISP_SCRIPT_ID = "runframe-crisp-chat-script";
6025
+ var TSCIRCUIT_HOSTNAME = "tscircuit.com";
6025
6026
  var pushCrispCommand = (command) => {
6026
6027
  window.$crisp = window.$crisp || [];
6027
6028
  window.$crisp.push(command);
@@ -6051,6 +6052,15 @@ var openCrispChat = () => {
6051
6052
  pushCrispCommand(["do", "chat:show"]);
6052
6053
  pushCrispCommand(["do", "chat:open"]);
6053
6054
  };
6055
+ var shouldShowCrispFeedbackButton = ({
6056
+ isCli,
6057
+ hostname = typeof window !== "undefined" ? window.location.hostname : void 0
6058
+ } = {}) => {
6059
+ if (isCli) return true;
6060
+ if (!hostname) return false;
6061
+ const normalizedHostname = hostname.toLowerCase();
6062
+ return normalizedHostname === TSCIRCUIT_HOSTNAME;
6063
+ };
6054
6064
  var CrispFeedbackButton = () => {
6055
6065
  return /* @__PURE__ */ jsx41(TooltipProvider, { children: /* @__PURE__ */ jsxs29(Tooltip, { children: [
6056
6066
  /* @__PURE__ */ jsx41(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx41(
@@ -6123,6 +6133,7 @@ var CircuitJsonPreview = ({
6123
6133
  allowSelectingVersion = true,
6124
6134
  showFileMenu = false,
6125
6135
  isWebEmbedded = false,
6136
+ isCli = false,
6126
6137
  projectName,
6127
6138
  schematicSvgOptions,
6128
6139
  onRerunWithDebug,
@@ -6296,7 +6307,7 @@ var CircuitJsonPreview = ({
6296
6307
  "%"
6297
6308
  ] })
6298
6309
  ] }),
6299
- showRightHeaderContent && /* @__PURE__ */ jsx42(CrispFeedbackButton, {}),
6310
+ showRightHeaderContent && shouldShowCrispFeedbackButton({ isCli }) && /* @__PURE__ */ jsx42(CrispFeedbackButton, {}),
6300
6311
  showRightHeaderContent && /* @__PURE__ */ jsxs30(TabsList, { children: [
6301
6312
  showCodeTab && /* @__PURE__ */ jsx42(TabsTrigger, { value: "code", children: "Code" }),
6302
6313
  !availableTabs || availableTabs.includes("pcb") ? /* @__PURE__ */ jsxs30(TabsTrigger, { value: "pcb", className: "rf-whitespace-nowrap", children: [
package/dist/preview.d.ts CHANGED
@@ -123,6 +123,10 @@ interface PreviewContentProps {
123
123
  * Whether the preview is being embedded in a web page
124
124
  */
125
125
  isWebEmbedded?: boolean;
126
+ /**
127
+ * Whether the preview is running in the tscircuit CLI surface.
128
+ */
129
+ isCli?: boolean;
126
130
  /**
127
131
  * Project name to use for exports
128
132
  */
@@ -143,7 +147,7 @@ declare global {
143
147
  }
144
148
  }
145
149
 
146
- declare const CircuitJsonPreview: ({ code, fsMap, onRunClicked, errorMessage, errorStack, circuitJson, autoroutingGraphics, showRightHeaderContent, showCodeTab, codeTabContent, showJsonTab, showRenderLogTab, onActiveTabChange, renderLog, showImportAndFormatButtons, className, headerClassName, leftHeaderContent, readOnly, isStreaming, autoroutingLog, onReportAutoroutingLog, isRunningCode, hasCodeChangedSinceLastRun, onEditEvent, editEvents, defaultActiveTab, defaultTab, availableTabs, autoRotate3dViewerDisabled, showSchematicDebugGrid: showSchematicDebugGridProp, showSchematicPorts: showSchematicPortsProp, onChangeShowSchematicDebugGrid, onChangeShowSchematicPorts, showToggleFullScreen, defaultToFullScreen, activeEffectName, allowSelectingVersion, showFileMenu, isWebEmbedded, projectName, schematicSvgOptions, onRerunWithDebug, solverEvents, onPcbBoundsSelected, }: PreviewContentProps) => react.JSX.Element;
150
+ declare const CircuitJsonPreview: ({ code, fsMap, onRunClicked, errorMessage, errorStack, circuitJson, autoroutingGraphics, showRightHeaderContent, showCodeTab, codeTabContent, showJsonTab, showRenderLogTab, onActiveTabChange, renderLog, showImportAndFormatButtons, className, headerClassName, leftHeaderContent, readOnly, isStreaming, autoroutingLog, onReportAutoroutingLog, isRunningCode, hasCodeChangedSinceLastRun, onEditEvent, editEvents, defaultActiveTab, defaultTab, availableTabs, autoRotate3dViewerDisabled, showSchematicDebugGrid: showSchematicDebugGridProp, showSchematicPorts: showSchematicPortsProp, onChangeShowSchematicDebugGrid, onChangeShowSchematicPorts, showToggleFullScreen, defaultToFullScreen, activeEffectName, allowSelectingVersion, showFileMenu, isWebEmbedded, isCli, projectName, schematicSvgOptions, onRerunWithDebug, solverEvents, onPcbBoundsSelected, }: PreviewContentProps) => react.JSX.Element;
147
151
 
148
152
  interface BomTableProps {
149
153
  circuitJson: AnyCircuitElement[];
package/dist/preview.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  SchematicViewer,
8
8
  useOrderDialog,
9
9
  useOrderDialogCli
10
- } from "./chunk-GK4LFSJL.js";
10
+ } from "./chunk-H3HMV7AK.js";
11
11
  export {
12
12
  BomTable,
13
13
  CadViewer,
package/dist/runner.d.ts CHANGED
@@ -55,6 +55,10 @@ interface RunFrameProps {
55
55
  * Whether the run frame is embedded in a web page
56
56
  */
57
57
  isWebEmbedded?: boolean;
58
+ /**
59
+ * Whether the run frame is running in the tscircuit CLI surface.
60
+ */
61
+ isCli?: boolean;
58
62
  /**
59
63
  * Whether to show the file menu
60
64
  */
@@ -190,6 +194,7 @@ interface RunFrameWithApiProps {
190
194
  evalWebWorkerBlobUrl?: string;
191
195
  showFileMenu?: boolean;
192
196
  schematicSvgOptions?: RunFrameProps["schematicSvgOptions"];
197
+ isCli?: boolean;
193
198
  /**
194
199
  * Enable fetch proxy for the web worker (useful for standalone bundles)
195
200
  */
package/dist/runner.js CHANGED
@@ -39,7 +39,7 @@ import {
39
39
  useRunFrameStore,
40
40
  useRunnerStore,
41
41
  useStyles
42
- } from "./chunk-GK4LFSJL.js";
42
+ } from "./chunk-H3HMV7AK.js";
43
43
 
44
44
  // lib/components/RunFrame/RunFrame.tsx
45
45
  import { createCircuitWebWorker } from "@tscircuit/eval/worker";
@@ -847,6 +847,7 @@ var RunFrame = (props) => {
847
847
  incRunCountTrigger(1);
848
848
  },
849
849
  solverEvents,
850
+ isCli: props.isCli,
850
851
  showSchematicDebugGrid,
851
852
  showSchematicPorts,
852
853
  onChangeShowSchematicDebugGrid: setShowSchematicDebugGrid,
@@ -1916,6 +1917,7 @@ var RunFrameWithApi = (props) => {
1916
1917
  {
1917
1918
  fsMap,
1918
1919
  showFileMenu: props.showFileMenu,
1920
+ isCli: props.isCli,
1919
1921
  schematicSvgOptions: props.schematicSvgOptions,
1920
1922
  isLoadingFiles,
1921
1923
  evalVersion: props.evalVersion,
@@ -2215,6 +2217,7 @@ var RunFrameForCli = (props) => {
2215
2217
  defaultToFullScreen: true,
2216
2218
  showToggleFullScreen: false,
2217
2219
  workerBlobUrl: props.workerBlobUrl,
2220
+ isCli: true,
2218
2221
  showFilesSwitch: true,
2219
2222
  showFileMenu: false,
2220
2223
  enableFetchProxy: props.enableFetchProxy,