@fugood/bricks-cli 2.25.0-beta.52 → 2.25.0-beta.53
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/lib/10.js +1 -1
- package/lib/117.js +6 -6
- package/lib/511.js +1 -1
- package/lib/index.js +6 -6
- package/package.json +2 -2
package/lib/117.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const __rspack_esm_id=117;export const __rspack_esm_ids=[117];export const __webpack_modules__={98372(e,i,t){t.r(i),t.d(i,{startStdioServer:()=>tJ});var n,a,o,r,s,d,c={};t.r(c),t.d(c,{applicationFragment:()=>es,applicationShortFragment:()=>ef,deviceFragment:()=>eo,deviceGroupFragment:()=>er,deviceShortFragment:()=>ey,instanceVersionFragment:()=>ep,mediaBoxFragment:()=>ev,mediaFileFragment:()=>eh,mediaWorkspaceFragment:()=>e$,moduleFragment:()=>ec,moduleShortFragment:()=>el,operationFragment:()=>eu,publicApplicationBasicInfoFragment:()=>ed,userFavoriteFragment:()=>em,workspaceFragment:()=>e_,workspaceShortFragment:()=>eg});var l={};t.r(l),t.d(l,{application:()=>eW,applicationByDevice:()=>eE,applicationReleaseVersion:()=>eT,applicationReleaseVersions:()=>eC,applicationTestsByDevice:()=>eU,applications:()=>eq,checkBindDevicePasscode:()=>eM,deviceUsage:()=>eV,devices:()=>ej,devicesByGroup:()=>eP,devicesByUniqueId:()=>eR,me:()=>ek,module:()=>eD,moduleReleaseVersion:()=>eB,moduleReleaseVersions:()=>ex,modules:()=>eA,publicModules:()=>eS,publicModulesByIdList:()=>ew,workspace:()=>eF,workspacePricingPlans:()=>eO,workspaces:()=>eN});var p={};t.r(p),t.d(p,{addUserFavorite:()=>iD,assignGroupPermissions:()=>ih,bindApplication:()=>e7,bindApplicationWithDeviceGroup:()=>it,changeWorkspaceAdditionalLimitSpending:()=>iw,changeWorkspaceSubscriptionPlan:()=>iS,controlDevice:()=>e0,createApplication:()=>e9,createApplicationWithShareVersion:()=>e3,createConfigChangeOperation:()=>ig,createDevice:()=>ez,createDeviceGroup:()=>e1,createDeviceGroupWithApp:()=>ir,createModule:()=>il,createVirtualDevice:()=>eH,createWorkspace:()=>eY,createWorkspaceOTP:()=>iC,dispatchDeviceGroupAction:()=>e6,doOperation:()=>iy,duplicateApplication:()=>id,duplicateModule:()=>im,forkApplication:()=>is,moveApplication:()=>io,moveDevice:()=>eX,moveModule:()=>iu,registerFCMNotification:()=>ib,registerRemoteDebug:()=>iI,removeApplication:()=>ic,removeDevice:()=>eZ,removeDeviceGroup:()=>e2,removeModule:()=>i_,removeOperation:()=>iv,removeUserFavorite:()=>iA,removeWorkspace:()=>e5,revokeWorkspaceOTP:()=>iT,shareAccessToken:()=>ik,shareApplication:()=>ia,toggleShortEditApplication:()=>ie,updateApplication:()=>e8,updateApplicationViewportPreset:()=>ii,updateDevice:()=>eJ,updateDeviceGroup:()=>e4,updateModule:()=>ip,updateOperation:()=>i$,updateVirtualDevice:()=>eQ,updateWorkspace:()=>eG,updateWorkspaceTokens:()=>eL});var u={};t.r(u),t.d(u,{application:()=>iM,applicationByDevice:()=>iR,applications:()=>iU,device:()=>iN,deviceUsage:()=>iW,devices:()=>iF,devicesByApplication:()=>iq,mediaBox:()=>iK,mediaBoxes:()=>iV,mediaFile:()=>iG,mediaFiles:()=>iY,mediaWorkspace:()=>ij,module:()=>iO,modules:()=>iP,workspace:()=>iE});var m={};t.r(m),t.d(m,{bindApplication:()=>iH,copyMediaFiles:()=>i6,createApplication:()=>iL,createModule:()=>iX,deleteMediaBoxFiles:()=>i5,deleteMediaFiles:()=>i2,requestFileUpload:()=>iZ,setMediaFileAsBoxPreview:()=>i4,unbindApplication:()=>iJ,updateApplication:()=>iz,updateMediaFile:()=>i0,updateMediaFiles:()=>i1,updateModule:()=>iQ});var _={};t.r(_),t.d(_,{mediaBox:()=>tg,mediaBoxes:()=>tm,mediaFile:()=>ty,mediaFiles:()=>tf,mediaWorkspace:()=>t_,mediaWorkspaces:()=>tu});var g={};t.r(g),t.d(g,{assignGroupPermissions:()=>tT,copyMediaFiles:()=>tw,createMediaBox:()=>th,createMediaWorkspace:()=>t$,deleteMediaFiles:()=>tS,moveMediaBox:()=>tb,requestFileUpload:()=>tk,setMediaFileAsBoxPreview:()=>tC,updateMediaBox:()=>tI,updateMediaFile:()=>tD,updateMediaFiles:()=>tA,updateMediaWorkspace:()=>tv});var f={};t.r(f),t.d(f,{mediaBox:()=>tB,mediaFile:()=>tU,mediaFiles:()=>tE});var y={};t.r(y),t.d(y,{deleteMediaFiles:()=>tO,requestFileUpload:()=>tM,updateMediaFile:()=>tR,updateMediaFiles:()=>tP});var $=t(99436),v=t(25326),h=t(66029),b={info:"info",manage_signature:"sign",query_application:"qa",query_device:"qd",query_device_group:"qdg",query_module:"qm",query_activity_log:"qal",create_application:"ca",create_device:"cd",create_device_group:"cdg",create_module:"cm",update_application:"ua",bind_application:"ba",short_edit_application:"uas",canvas_control_application:"uacc",update_device:"ud",update_device_group:"udg",update_module:"um",short_edit_module:"ums",remove_application:"ra",remove_device:"rd",remove_device_group:"rdg",remove_module:"rm",control_device:"ctld",control_application_device:"ctlad",control_device_group:"ctldg",query_media_flow:"qmf",write_media_flow:"wmf",access_unstable_feature:"UNSTABLE"},I=Object.entries(b).reduce((e,[i,t])=>(e[t]=i,e),{}),k=["HS256","RS256"],D=["https://auth0.bricks.tools/","https://mybigday.auth0.com/"],A=t(84867);let S='# Getting Started with BRICKS\n\nBRICKS (方塊磚) is a comprehensive platform for creating interactive multimedia display applications specifically designed for digital signage screens. It enables users to design complete applications without programming, using a visual, component-based approach.\n\n**Important**: Users interact through a visual GUI editor, not raw configuration files. Always describe features in user-friendly terms:\n- "text display" not "BRICK_TEXT"\n- "image" not "BRICK_IMAGE"\n- "canvas name" not "CANVAS_xxx"\n- "data storage" not "PROPERTY_BANK"\n- Focus on what users see and do, not technical implementation details\n\n## Core Philosophy\n\nBRICKS operates as a **Launcher system** that reads configuration files from the cloud (or cached locally) and must maintain normal operation even when offline. The system periodically reports health status and supports watchdog timers for automatic restart or maintenance mode activation.\n\n## Fundamental Architecture\n\n### The Three Core Elements\n\n#### 1. Canvas (畫布)\n- **Definition**: The visual container that defines what users see on screen\n- **Behavior**: Screen transitions occur by switching between different canvases\n- **Smart Transitions**: When switching canvases, BRICKS automatically compares shared elements and smoothly animates their position/size changes\n- **Properties**:\n - `Showing Timeout`: Auto-advance to next canvas after specified time\n - `Next Canvas ID`: Target canvas for timeout transitions\n - `Background Color`: Canvas background\n - `Dismiss Keyboard On Press`: Touch behavior for keyboard dismissal\n- **Events**: `CANVAS_FIRST_ENTER`, `CANVAS_ENTER`, `CANVAS_SHOWING_TIMEOUT`, `CANVAS_EXIT`\n\n#### 2. Brick (方塊)\n- **Definition**: Visual components that display content and handle user interactions\n- **Animation System**: All bricks support three animation phases:\n - **Enter Animation**: How the brick appears on screen\n - **Display Animation**: Ongoing animations while visible\n - **Exit Animation**: How the brick disappears\n- **Positioning**: Uses grid-based positioning system for resolution independence\n- **Interaction**: Can respond to touch events and trigger system actions\n\nAvailable template:\n[:BRICK_IDS:]\n\n#### 3. Generator (處理器)\n- **Definition**: Invisible processing units that handle non-visual functionality\n- **Purpose**: Handle hardware interactions (camera, sensors), data processing, network communication\n- **Input**: Receives parameters exclusively through Property Bank\n- **Output**: Returns results exclusively through Property Bank\n- **Triggers**: Activated by Events connected to their Actions\n\nAvailable template:\n[:GENERATOR_IDS:]\n\n### Data (Property Bank, 參數庫)\nThe central data management system that serves as the backbone of BRICKS applications:\n\n#### Key Features\n- **KEY-VALUE Structure**: Simple, accessible data storage\n- **Dual Events**: Each property supports both "Update" and "Value Change" events\n- **Auto-Refresh**: UI elements automatically update when linked data changes\n- **Cross-Subspace Communication**: Properties can be shared between different subspaces\n- **Data Types**: `string`, `number`, `bool`, `object`, `array`, `any`\n- **Special Kinds**: `color`, `datetime`, `id`, `media-resource-*`, `lottie-file-uri`\n- **Units**: `grid`, `px`, `ms` for different measurement types\n\n#### Routing Options\n- **read-only**: Cannot be changed from other subspaces\n- **Default**: Accepts changes from other subspaces\n\nTerminology note: We refer to the central data system as "Data" in docs and UI. Internally, it remains "Property Bank" and uses `PROPERTY_BANK_*` identifiers.\n\n### Event System\nBRICKS uses a comprehensive event-driven architecture:\n\n#### Event Sources\n- **System Events**: Property Bank changes, timer events, canvas transitions\n- **Brick Events**: User interactions (press, focus, value changes)\n- **Generator Events**: Hardware responses, network callbacks, processing completions\n\n#### Event Handling\n- **Sequential Processing**: Events trigger Actions in defined order\n- **Parameter Passing**: All parameters passed through Property Bank\n- **Action Types**: System actions or Generator actions\n\n### Subspace (子空間)\nAdvanced modularity system for complex applications:\n\n#### Concept\n- **Nested Systems**: Complete BRICKS system within a brick\n- **Independent Operation**: Own canvases, bricks, and property banks\n- **Modular Behavior**: Can be positioned, scaled, and animated like regular bricks\n\n#### Communication\n- **Input**: External Property Bank values copied to internal Property Bank\n- **Output**: Internal Property Bank changes trigger external events\n- **Data Flow**: Call-by-value copying maintains isolation while enabling communication\n\n## Grid System\n\n### Resolution Independence\n- **Default Grid**: 96\xd754 units (optimized for HD displays)\n- **Automatic Scaling**: Grid units convert to pixels based on device resolution\n- **Calculation**: `grid_unit_size_px = device_width_px / app_grid_width`\n\n### Examples\n| Device Resolution | App Grid Size | Grid Unit Size |\n|------------------|---------------|----------------|\n| 1920\xd71080 | 96\xd754 | 20px |\n| 3840\xd72160 | 96\xd754 | 40px |\n| 1280\xd7720 | 96\xd754 | 13.33px |\n\n### Positioning Features\n- **Overflow Support**: Elements can extend beyond visible area\n- **Partial Display**: Elements at negative positions show partial content\n- **Performance Optimization**: Completely off-screen elements are automatically ignored\n\n## Configuration Structure\n\n### Hierarchy\n```\nApplication (應用程式)\n├── Root Subspace\n├── Subspace Map\n│ ├── Canvas Map\n│ ├── Brick Map\n│ └── Generator Map\n├── Property Bank\n├── Property Bank Calc\n├── Event Map\n└── Automation Map\n```\n\n### Item property\nProperties can set constant value or link data like this\n\n```js\n{\n "example1": 123,\n "example2": "PROPERTY_BANK#<Data Node ID>", // Link Data\n "example3": {\n "PROPERTY_BANK#<Data Node ID>", // Link Data in object, we recommend direct link without middle object data\n }\n}\n```\n\n### Item outlet\nData output from brick or generator, you can link it to data\n\n```js\n{\n OUTLET_NAME: \'<Data Node ID>\'\n}\n```\n\n### Event actions\nOn handling event can do actions with this schema\n\n```js\n[\n {\n "action": "string",\n "handler": "string",\n "parameter_list": [\n {\n "input_to_receiver": "string", // Argument\n "result_from_sender": "string" // Link data\n }\n ],\n "wait_async": "boolean"\n }\n]\n```\n\n- `handler: SYSTEM`\n[:SYSTEM_ACTIONS:]\n- `handler: GENERATOR_<UUID>`\n- `handler: BRICK_<UUID>`\n\n## Development Workflow\n\n### 1. Design Phase\n- Define grid layout (usually 96\xd754)\n- Plan canvas flow and transitions\n- Identify required data flows\n\n### 2. Implementation\n- Use `create_item` to constuct config\n- Create subspaces for different app sections\n- Add canvases for each screen/state\n- Place and configure bricks for UI elements\n- Add generators for processing logic\n- Connect events to actions\n\n### 3. Data Management\n- Set up Property Bank structure\n- Configure property types and routing\n- Link UI elements to data sources\n- Implement data processing flows\n\n#### Mental Model\n- Reactive architecture: events trigger actions; actions update Data; UI and generators react to Data changes.\n- Calculations: optional graphs transform Data using Data Calculation (command/data nodes or script).\n- Always read/write via Data. Generators receive input from Data and write outputs back to Data.\n\n#### Common Patterns\n- Event → Action → Data update or Outlet → Data update\n- Data change → Triggers downstream calculations → Updates target Data\n- Cross-subspace routing: respect `read-only` vs `default`\n\n### 4. Testing & Deployment\n- Use automation maps for testing\n- Validate configuration schema\n- Deploy to target devices\n- Monitor system health\n\n## Best Practices\n\n### Performance\n- Use 96\xd754 grid for standard content\n- Minimize off-screen elements\n- Optimize property bank access patterns\n- Cache media resources appropriately\n\n### User Experience\n- Always use enter/exit animations (avoid sudden appearances)\n- Maintain consistent transition timing\n- Design for offline operation\n- Implement proper error handling\n\n### Architecture\n- Keep subspaces focused and modular\n- Use generators for all non-visual processing\n- Minimize cross-subspace dependencies\n- Design for reusability through modules\n\n## Network & Offline Behavior\n\n### Online Operation\n- Configuration sync from cloud\n- Media resource loading\n- Real-time data updates\n- Health status reporting\n\n### Offline Requirements\n- **Display Continuity**: All display and reading functions must work offline\n- **Data Caching**: Write operations cached locally and synced when online\n- **Resource Management**: Media and assets preloaded during online periods\n- **Graceful Degradation**: Non-essential features disabled, core functionality maintained\n\nThis comprehensive foundation enables the creation of sophisticated, interactive digital signage applications that are both powerful and maintainable.\n\n## Local Sync\n\nLocal Sync enables near real-time intranet communication between devices for seamless multi-screen display splicing.\n\n- Data Sync: Synchronize selected data (Property Bank/Data nodes) across devices so UI updates remain consistent.\n- Canvas Sync: Optionally synchronize active canvas to orchestrate state transitions across screens.\n- Typical Use: Video walls, tiled displays, or clustered players that must behave as one.\n- Transport: LAN/intranet only; optimized for low latency and reliability inside the local network.\n- Resilience: Designed to tolerate temporary disconnections; devices rejoin and resynchronize state.\n\nConfiguration hints (high level):\n- Subspaces can define local sync behavior (e.g., whether to sync canvas changes).\n- Generators may opt into specific local sync run modes.\n- Keep payloads small and data normalized for best performance.';var w=t(20181),C=(e,i={})=>({content:[w.Buffer.isBuffer(e)?{...i,blob:e.toString("base64"),type:"blob"}:{...i,text:"string"==typeof e?e:JSON.stringify(e,null,2),type:"text"}],isError:!1}),T=t(68832),x=t(79657),B=t(79861),E=t(46123),U=t(80211),M=t(45907),R=t(99548),P=t(96423),O=U.ajv.getSchema("http://display.bricks.tools/root.schema.json5"),F=(0,P.A)(["subspace_map.*.property_bank_calc_map.*.script_config"]);function N(e){var i=[];try{var t=U(e);i.push(...(0,R.L)({errors:t,schema:O,data:e}).map(({path:e,message:i})=>`${e}: ${i}`));try{i.push(...M(e).map(({field:e,message:i})=>`${e}: ${i}`))}catch(e){i.push(`Component reference validation failed: ${e.message}`)}return F(e).forEach(t=>{var n=t.slice(0,-1),a=E(e,n),o=n.join(".");if(0===Object.keys(a.map).length)i.push(`${o}.map is empty`);else{var r=a.script_config,s=r.inputs,d=r.output,c=r.outputs,l=r.error;s&&Object.keys(s).forEach(e=>{a.map[e]||i.push(`${o}.map.${e} is missing`)}),d&&!a.map[d]&&i.push(`${o}.map.${d} is missing`),c&&Object.values(c).forEach(e=>{a.map[e]||i.push(`${o}.map.${e} is missing`)}),l&&!a.map[l]&&i.push(`${o}.map.${l} is missing`)}}),{valid:0===i.length,errors:i}}catch(e){return{valid:!1,errors:[`Validation failed: ${e.message}`]}}}var q=t(49741),W=t(63981),j=(e,i="en-us")=>"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,"object"!=typeof t||Array.isArray(t)?t:t[i]??j(t,i)])):e,V=j(q.t),K=Object.entries(q.systemActions).map(([e,{propertyNameType:i,property:t}])=>` - \`${e}\`: ${V[e]}
|
|
1
|
+
export const __rspack_esm_id=117;export const __rspack_esm_ids=[117];export const __webpack_modules__={98372(e,i,t){t.r(i),t.d(i,{startStdioServer:()=>tJ});var n,a,o,r,s,d,c={};t.r(c),t.d(c,{applicationFragment:()=>es,applicationShortFragment:()=>ef,deviceFragment:()=>eo,deviceGroupFragment:()=>er,deviceShortFragment:()=>ey,instanceVersionFragment:()=>ep,mediaBoxFragment:()=>ev,mediaFileFragment:()=>eh,mediaWorkspaceFragment:()=>e$,moduleFragment:()=>ec,moduleShortFragment:()=>el,operationFragment:()=>eu,publicApplicationBasicInfoFragment:()=>ed,userFavoriteFragment:()=>em,workspaceFragment:()=>e_,workspaceShortFragment:()=>eg});var l={};t.r(l),t.d(l,{application:()=>eW,applicationByDevice:()=>eE,applicationReleaseVersion:()=>eT,applicationReleaseVersions:()=>eC,applicationTestsByDevice:()=>eU,applications:()=>eq,checkBindDevicePasscode:()=>eM,deviceUsage:()=>eV,devices:()=>ej,devicesByGroup:()=>eP,devicesByUniqueId:()=>eR,me:()=>ek,module:()=>eD,moduleReleaseVersion:()=>eB,moduleReleaseVersions:()=>ex,modules:()=>eA,publicModules:()=>eS,publicModulesByIdList:()=>ew,workspace:()=>eF,workspacePricingPlans:()=>eO,workspaces:()=>eN});var p={};t.r(p),t.d(p,{addUserFavorite:()=>iD,assignGroupPermissions:()=>ih,bindApplication:()=>e7,bindApplicationWithDeviceGroup:()=>it,changeWorkspaceAdditionalLimitSpending:()=>iw,changeWorkspaceSubscriptionPlan:()=>iS,controlDevice:()=>e0,createApplication:()=>e9,createApplicationWithShareVersion:()=>e3,createConfigChangeOperation:()=>ig,createDevice:()=>ez,createDeviceGroup:()=>e1,createDeviceGroupWithApp:()=>ir,createModule:()=>il,createVirtualDevice:()=>eH,createWorkspace:()=>eY,createWorkspaceOTP:()=>iC,dispatchDeviceGroupAction:()=>e6,doOperation:()=>iy,duplicateApplication:()=>id,duplicateModule:()=>im,forkApplication:()=>is,moveApplication:()=>io,moveDevice:()=>eX,moveModule:()=>iu,registerFCMNotification:()=>ib,registerRemoteDebug:()=>iI,removeApplication:()=>ic,removeDevice:()=>eZ,removeDeviceGroup:()=>e5,removeModule:()=>i_,removeOperation:()=>iv,removeUserFavorite:()=>iA,removeWorkspace:()=>e2,revokeWorkspaceOTP:()=>iT,shareAccessToken:()=>ik,shareApplication:()=>ia,toggleShortEditApplication:()=>ie,updateApplication:()=>e8,updateApplicationViewportPreset:()=>ii,updateDevice:()=>eJ,updateDeviceGroup:()=>e4,updateModule:()=>ip,updateOperation:()=>i$,updateVirtualDevice:()=>eQ,updateWorkspace:()=>eG,updateWorkspaceTokens:()=>eL});var u={};t.r(u),t.d(u,{application:()=>iM,applicationByDevice:()=>iR,applications:()=>iU,device:()=>iN,deviceUsage:()=>iW,devices:()=>iF,devicesByApplication:()=>iq,mediaBox:()=>iK,mediaBoxes:()=>iV,mediaFile:()=>iG,mediaFiles:()=>iY,mediaWorkspace:()=>ij,module:()=>iO,modules:()=>iP,workspace:()=>iE});var m={};t.r(m),t.d(m,{bindApplication:()=>iH,copyMediaFiles:()=>i6,createApplication:()=>iL,createModule:()=>iX,deleteMediaBoxFiles:()=>i2,deleteMediaFiles:()=>i5,requestFileUpload:()=>iZ,setMediaFileAsBoxPreview:()=>i4,unbindApplication:()=>iJ,updateApplication:()=>iz,updateMediaFile:()=>i0,updateMediaFiles:()=>i1,updateModule:()=>iQ});var _={};t.r(_),t.d(_,{mediaBox:()=>tg,mediaBoxes:()=>tm,mediaFile:()=>ty,mediaFiles:()=>tf,mediaWorkspace:()=>t_,mediaWorkspaces:()=>tu});var g={};t.r(g),t.d(g,{assignGroupPermissions:()=>tT,copyMediaFiles:()=>tw,createMediaBox:()=>th,createMediaWorkspace:()=>t$,deleteMediaFiles:()=>tS,moveMediaBox:()=>tb,requestFileUpload:()=>tk,setMediaFileAsBoxPreview:()=>tC,updateMediaBox:()=>tI,updateMediaFile:()=>tD,updateMediaFiles:()=>tA,updateMediaWorkspace:()=>tv});var f={};t.r(f),t.d(f,{mediaBox:()=>tB,mediaFile:()=>tU,mediaFiles:()=>tE});var y={};t.r(y),t.d(y,{deleteMediaFiles:()=>tO,requestFileUpload:()=>tM,updateMediaFile:()=>tR,updateMediaFiles:()=>tP});var $=t(99436),v=t(25326),h=t(66029),b={info:"info",manage_signature:"sign",query_application:"qa",query_device:"qd",query_device_group:"qdg",query_module:"qm",query_activity_log:"qal",create_application:"ca",create_device:"cd",create_device_group:"cdg",create_module:"cm",update_application:"ua",bind_application:"ba",short_edit_application:"uas",canvas_control_application:"uacc",update_device:"ud",update_device_group:"udg",update_module:"um",short_edit_module:"ums",remove_application:"ra",remove_device:"rd",remove_device_group:"rdg",remove_module:"rm",control_device:"ctld",control_application_device:"ctlad",control_device_group:"ctldg",query_media_flow:"qmf",write_media_flow:"wmf",access_unstable_feature:"UNSTABLE"},I=Object.entries(b).reduce((e,[i,t])=>(e[t]=i,e),{}),k=["HS256","RS256"],D=["https://auth0.bricks.tools/","https://mybigday.auth0.com/"],A=t(84867);let S='# Getting Started with BRICKS\n\nBRICKS (方塊磚) is a comprehensive platform for creating interactive multimedia display applications specifically designed for digital signage screens. It enables users to design complete applications without programming, using a visual, component-based approach.\n\n**Important**: Users interact through a visual GUI editor, not raw configuration files. Always describe features in user-friendly terms:\n- "text display" not "BRICK_TEXT"\n- "image" not "BRICK_IMAGE"\n- "canvas name" not "CANVAS_xxx"\n- "data storage" not "PROPERTY_BANK"\n- Focus on what users see and do, not technical implementation details\n\n## Core Philosophy\n\nBRICKS operates as a **Launcher system** that reads configuration files from the cloud (or cached locally) and must maintain normal operation even when offline. The system periodically reports health status and supports watchdog timers for automatic restart or maintenance mode activation.\n\n## Fundamental Architecture\n\n### The Three Core Elements\n\n#### 1. Canvas (畫布)\n- **Definition**: The visual container that defines what users see on screen\n- **Behavior**: Screen transitions occur by switching between different canvases\n- **Smart Transitions**: When switching canvases, BRICKS automatically compares shared elements and smoothly animates their position/size changes\n- **Properties**:\n - `Showing Timeout`: Auto-advance to next canvas after specified time\n - `Next Canvas ID`: Target canvas for timeout transitions\n - `Background Color`: Canvas background\n - `Dismiss Keyboard On Press`: Touch behavior for keyboard dismissal\n- **Events**: `CANVAS_FIRST_ENTER`, `CANVAS_ENTER`, `CANVAS_SHOWING_TIMEOUT`, `CANVAS_EXIT`\n\n#### 2. Brick (方塊)\n- **Definition**: Visual components that display content and handle user interactions\n- **Animation System**: All bricks support three animation phases:\n - **Enter Animation**: How the brick appears on screen\n - **Display Animation**: Ongoing animations while visible\n - **Exit Animation**: How the brick disappears\n- **Positioning**: Uses grid-based positioning system for resolution independence\n- **Interaction**: Can respond to touch events and trigger system actions\n\nAvailable template:\n[:BRICK_IDS:]\n\n#### 3. Generator (處理器)\n- **Definition**: Invisible processing units that handle non-visual functionality\n- **Purpose**: Handle hardware interactions (camera, sensors), data processing, network communication\n- **Input**: Receives parameters exclusively through Property Bank\n- **Output**: Returns results exclusively through Property Bank\n- **Triggers**: Activated by Events connected to their Actions\n\nAvailable template:\n[:GENERATOR_IDS:]\n\n### Data (Property Bank, 參數庫)\nThe central data management system that serves as the backbone of BRICKS applications:\n\n#### Key Features\n- **KEY-VALUE Structure**: Simple, accessible data storage\n- **Dual Events**: Each property supports both "Update" and "Value Change" events\n- **Auto-Refresh**: UI elements automatically update when linked data changes\n- **Cross-Subspace Communication**: Properties can be shared between different subspaces\n- **Data Types**: `string`, `number`, `bool`, `object`, `array`, `any`\n- **Special Kinds**: `color`, `datetime`, `id`, `media-resource-*`, `lottie-file-uri`\n- **Units**: `grid`, `px`, `ms` for different measurement types\n\n#### Routing Options\n- **read-only**: Cannot be changed from other subspaces\n- **Default**: Accepts changes from other subspaces\n\nTerminology note: We refer to the central data system as "Data" in docs and UI. Internally, it remains "Property Bank" and uses `PROPERTY_BANK_*` identifiers.\n\n### Event System\nBRICKS uses a comprehensive event-driven architecture:\n\n#### Event Sources\n- **System Events**: Property Bank changes, timer events, canvas transitions\n- **Brick Events**: User interactions (press, focus, value changes)\n- **Generator Events**: Hardware responses, network callbacks, processing completions\n\n#### Event Handling\n- **Sequential Processing**: Events trigger Actions in defined order\n- **Parameter Passing**: All parameters passed through Property Bank\n- **Action Types**: System actions or Generator actions\n\n### Subspace (子空間)\nAdvanced modularity system for complex applications:\n\n#### Concept\n- **Nested Systems**: Complete BRICKS system within a brick\n- **Independent Operation**: Own canvases, bricks, and property banks\n- **Modular Behavior**: Can be positioned, scaled, and animated like regular bricks\n\n#### Communication\n- **Input**: External Property Bank values copied to internal Property Bank\n- **Output**: Internal Property Bank changes trigger external events\n- **Data Flow**: Call-by-value copying maintains isolation while enabling communication\n\n## Grid System\n\n### Resolution Independence\n- **Default Grid**: 96\xd754 units (optimized for HD displays)\n- **Automatic Scaling**: Grid units convert to pixels based on device resolution\n- **Calculation**: `grid_unit_size_px = device_width_px / app_grid_width`\n\n### Examples\n| Device Resolution | App Grid Size | Grid Unit Size |\n|------------------|---------------|----------------|\n| 1920\xd71080 | 96\xd754 | 20px |\n| 3840\xd72160 | 96\xd754 | 40px |\n| 1280\xd7720 | 96\xd754 | 13.33px |\n\n### Positioning Features\n- **Overflow Support**: Elements can extend beyond visible area\n- **Partial Display**: Elements at negative positions show partial content\n- **Performance Optimization**: Completely off-screen elements are automatically ignored\n\n## Configuration Structure\n\n### Hierarchy\n```\nApplication (應用程式)\n├── Root Subspace\n├── Subspace Map\n│ ├── Canvas Map\n│ ├── Brick Map\n│ └── Generator Map\n├── Property Bank\n├── Property Bank Calc\n├── Event Map\n└── Automation Map\n```\n\n### Item property\nProperties can set constant value or link data like this\n\n```js\n{\n "example1": 123,\n "example2": "PROPERTY_BANK#<Data Node ID>", // Link Data\n "example3": {\n "PROPERTY_BANK#<Data Node ID>", // Link Data in object, we recommend direct link without middle object data\n }\n}\n```\n\n### Item outlet\nData output from brick or generator, you can link it to data\n\n```js\n{\n OUTLET_NAME: \'<Data Node ID>\'\n}\n```\n\n### Event actions\nOn handling event can do actions with this schema\n\n```js\n[\n {\n "action": "string",\n "handler": "string",\n "parameter_list": [\n {\n "input_to_receiver": "string", // Argument\n "result_from_sender": "string" // Link data\n }\n ],\n "wait_async": "boolean"\n }\n]\n```\n\n- `handler: SYSTEM`\n[:SYSTEM_ACTIONS:]\n- `handler: GENERATOR_<UUID>`\n- `handler: BRICK_<UUID>`\n\n## Development Workflow\n\n### 1. Design Phase\n- Define grid layout (usually 96\xd754)\n- Plan canvas flow and transitions\n- Identify required data flows\n\n### 2. Implementation\n- Use `create_item` to constuct config\n- Create subspaces for different app sections\n- Add canvases for each screen/state\n- Place and configure bricks for UI elements\n- Add generators for processing logic\n- Connect events to actions\n\n### 3. Data Management\n- Set up Property Bank structure\n- Configure property types and routing\n- Link UI elements to data sources\n- Implement data processing flows\n\n#### Mental Model\n- Reactive architecture: events trigger actions; actions update Data; UI and generators react to Data changes.\n- Calculations: optional graphs transform Data using Data Calculation (command/data nodes or script).\n- Always read/write via Data. Generators receive input from Data and write outputs back to Data.\n\n#### Common Patterns\n- Event → Action → Data update or Outlet → Data update\n- Data change → Triggers downstream calculations → Updates target Data\n- Cross-subspace routing: respect `read-only` vs `default`\n\n### 4. Testing & Deployment\n- Use automation maps for testing\n- Validate configuration schema\n- Deploy to target devices\n- Monitor system health\n\n## Best Practices\n\n### Performance\n- Use 96\xd754 grid for standard content\n- Minimize off-screen elements\n- Optimize property bank access patterns\n- Cache media resources appropriately\n\n### User Experience\n- Always use enter/exit animations (avoid sudden appearances)\n- Maintain consistent transition timing\n- Design for offline operation\n- Implement proper error handling\n\n### Architecture\n- Keep subspaces focused and modular\n- Use generators for all non-visual processing\n- Minimize cross-subspace dependencies\n- Design for reusability through modules\n\n## Network & Offline Behavior\n\n### Online Operation\n- Configuration sync from cloud\n- Media resource loading\n- Real-time data updates\n- Health status reporting\n\n### Offline Requirements\n- **Display Continuity**: All display and reading functions must work offline\n- **Data Caching**: Write operations cached locally and synced when online\n- **Resource Management**: Media and assets preloaded during online periods\n- **Graceful Degradation**: Non-essential features disabled, core functionality maintained\n\nThis comprehensive foundation enables the creation of sophisticated, interactive digital signage applications that are both powerful and maintainable.\n\n## Local Sync\n\nLocal Sync enables near real-time intranet communication between devices for seamless multi-screen display splicing.\n\n- Data Sync: Synchronize selected data (Property Bank/Data nodes) across devices so UI updates remain consistent.\n- Canvas Sync: Optionally synchronize active canvas to orchestrate state transitions across screens.\n- Typical Use: Video walls, tiled displays, or clustered players that must behave as one.\n- Transport: LAN/intranet only; optimized for low latency and reliability inside the local network.\n- Resilience: Designed to tolerate temporary disconnections; devices rejoin and resynchronize state.\n\nConfiguration hints (high level):\n- Subspaces can define local sync behavior (e.g., whether to sync canvas changes).\n- Generators may opt into specific local sync run modes.\n- Keep payloads small and data normalized for best performance.';var w=t(20181),C=(e,i={})=>({content:[w.Buffer.isBuffer(e)?{...i,blob:e.toString("base64"),type:"blob"}:{...i,text:"string"==typeof e?e:JSON.stringify(e,null,2),type:"text"}],isError:!1}),T=t(68832),x=t(79657),B=t(79861),E=t(46123),U=t(80211),M=t(45907),R=t(99548),P=t(96423),O=U.ajv.getSchema("http://display.bricks.tools/root.schema.json5"),F=(0,P.A)(["subspace_map.*.property_bank_calc_map.*.script_config"]);function N(e){var i=[];try{var t=U(e);i.push(...(0,R.L)({errors:t,schema:O,data:e}).map(({path:e,message:i})=>`${e}: ${i}`));try{i.push(...M(e).map(({field:e,message:i})=>`${e}: ${i}`))}catch(e){i.push(`Component reference validation failed: ${e.message}`)}return F(e).forEach(t=>{var n=t.slice(0,-1),a=E(e,n),o=n.join(".");if(0===Object.keys(a.map).length)i.push(`${o}.map is empty`);else{var r=a.script_config,s=r.inputs,d=r.output,c=r.outputs,l=r.error;s&&Object.keys(s).forEach(e=>{a.map[e]||i.push(`${o}.map.${e} is missing`)}),d&&!a.map[d]&&i.push(`${o}.map.${d} is missing`),c&&Object.values(c).forEach(e=>{a.map[e]||i.push(`${o}.map.${e} is missing`)}),l&&!a.map[l]&&i.push(`${o}.map.${l} is missing`)}}),{valid:0===i.length,errors:i}}catch(e){return{valid:!1,errors:[`Validation failed: ${e.message}`]}}}var q=t(49741),W=t(63981),j=(e,i="en-us")=>"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,"object"!=typeof t||Array.isArray(t)?t:t[i]??j(t,i)])):e,V=j(q.t),K=Object.entries(q.systemActions).map(([e,{propertyNameType:i,property:t}])=>` - \`${e}\`: ${V[e]}
|
|
2
2
|
${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i])=>` - \`${e}\`: ${JSON.stringify(i)}`).join("\n");case"property_bank":return" - `PROPERTY_BANK_DATA_NODE_*`: Value";default:return""}})(i,t)}
|
|
3
3
|
`.trim()).join("\n"),Y=Object.keys(W.brickMapping).map(e=>`- \`${e}\``).join("\n"),G=Object.keys(W.generatorMapping).map(e=>`- \`${e}\``).join("\n");let L=S.replace("[:SYSTEM_ACTIONS:]",K).replace("[:BRICK_IDS:]",Y).replace("[:GENERATOR_IDS:]",G);var z=t(44668),H=t(5018),J=t(63315),X=t(30409),Q=t(40906),Z=t(79760),ee=t(22268),ei=t(7068),et=t(26197),en=t(94370);let ea=(0,en.default)`
|
|
4
4
|
fragment workspaceArguments on Workspace {
|
|
@@ -1234,11 +1234,11 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1234
1234
|
dispatched
|
|
1235
1235
|
}
|
|
1236
1236
|
}
|
|
1237
|
-
`),
|
|
1237
|
+
`),e5=eK((0,en.default)`
|
|
1238
1238
|
mutation ControllerClient_removeDeviceGroup($id: ID!) {
|
|
1239
1239
|
removeDeviceGroup(id: $id)
|
|
1240
1240
|
}
|
|
1241
|
-
`),
|
|
1241
|
+
`),e2=eK((0,en.default)`
|
|
1242
1242
|
mutation ControllerClient_removeWorkspace($id: ID!) {
|
|
1243
1243
|
removeWorkspace(id: $id)
|
|
1244
1244
|
}
|
|
@@ -1971,11 +1971,11 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
1971
1971
|
mutation Workspace_copyMediaFiles($fromBoxId: ID!, $toBoxId: ID!, $fileIds: [ID!]!) {
|
|
1972
1972
|
copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, fileIds: $fileIds)
|
|
1973
1973
|
}
|
|
1974
|
-
`,
|
|
1974
|
+
`,i5=(0,en.default)`
|
|
1975
1975
|
mutation Workspace_deleteMediaFiles($boxId: ID!, $fileIds: [ID!]!) {
|
|
1976
1976
|
deleteMediaFiles(boxId: $boxId, fileIds: $fileIds)
|
|
1977
1977
|
}
|
|
1978
|
-
`,
|
|
1978
|
+
`,i2=(0,en.default)`
|
|
1979
1979
|
mutation Workspace_deleteMediaBoxFiles($boxId: ID!, $includeTypes: [String]) {
|
|
1980
1980
|
deleteMediaBoxFiles(boxId: $boxId, includeTypes: $includeTypes)
|
|
1981
1981
|
}
|
|
@@ -2472,7 +2472,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
|
|
|
2472
2472
|
timestamp
|
|
2473
2473
|
}
|
|
2474
2474
|
}
|
|
2475
|
-
`,tK=z(function e(i,t){H(this,e),this.baseUrl=i,this.token=t,this.graphqlUrl=`${i}/api/graphql`},[{key:"graphql",value:(o=$(function*(e,i){var t=yield(0,x.Ay)(this.graphqlUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.token}`,Accept:"application/json"},body:JSON.stringify({query:e,variables:i})});if(!t.ok){var n=yield t.text().catch(()=>"");throw Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return o.apply(this,arguments)})},{key:"events",value:(r=$(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql(tj,{filter:n})).events}),function(e){return r.apply(this,arguments)})},{key:"screenshots",value:(s=$(function*(e){return(yield this.graphql(tV,{filter:e})).screenshots}),function(e){return s.apply(this,arguments)})},{key:"downloadScreenshot",value:(d=$(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,x.Ay)(n,{headers:{Authorization:`Bearer ${this.token}`}});if(!a.ok){var o=yield a.text().catch(()=>"");throw Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from((yield a.arrayBuffer()))}),function(e,i,t){return d.apply(this,arguments)})}]);process.env.STAGE,process.env.URL_BASE;var tY="bricks-mcp",tG={bricks:process.env.BRICKS_API_SERVER||"https://display-beta.bricks.tools",media:process.env.MEDIA_API_SERVER||"https://media-beta.bricks.tools",activityLog:process.env.ACTIVITY_LOG_API_SERVER||"https://activity-log-beta.bricks.tools"};process.env.AUTH0_DOMAIN,process.env.CACHE_URL;var tL=t(1639);let tz=({type:e,title:i,template_key:t})=>{var n,a,o=(0,tL.M4)(e);switch(e){case"subspace":n={title:i,layout:{width:"number",height:"number"},root_canvas_id:"CANVAS_<UUID>",canvas_map:{},brick_map:{},animation_map:{},generator_map:{},property_bank_map:{},property_bank_calc_map:{}},a={"canvas_map.CANVAS_<UUID>.item_list":[{type:"subspace",subspace_id:"SUBSPACE_<UUID>",$note:"If not a root subspace, it can be linked to canvas in other subspace"}]};break;case"canvas":var r=j(W.Ji);n={title:i,item_list:[],property:{$definitions:Object.fromEntries(Object.entries(r.propTypes).map(([e,i])=>[e,{...i,description:r.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(r.eventTypes).map(([e])=>[e,{description:r.brickEventDescriptions[e]}]))}},a={property_bank_map:{[(0,tL.M4)("property_bank")]:{title:`Canvas ID: ${i}`,type:"string",value:o,routing:"read-only",kind:"auto-generated-item-id",idType:"canvas"}}};break;case"brick":var s=j(W.dK.Basic),d=j(W.brickMapping[t]);if(!d)throw Error(`Brick ${t} not found`);var c={...d,propTypes:{...s.propTypes,...d.propTypes},brickPropDescriptions:{...s.brickPropDescriptions,...d.brickPropDescriptions},eventTypes:{...s.eventTypes,...d.eventTypes},brickEventDescriptions:{...s.brickEventDescriptions,...d.brickEventDescriptions}};n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(c.propTypes).map(([e,i])=>[e,{...i,description:c.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(c.eventTypes).map(([e])=>[e,{description:c.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(c.outletTypes).map(([e])=>[e,{description:c.brickOutletDescriptions[e]}]))},state_group:{"BRICK_STATE_GROUP_<UUID>":{}}},a={canvas_map:{"CANVAS_<UUID WHICH NEED DISPLAY THIS BRICK>":{item_list:[{type:"brick",brick_id:o,frame:{x:"number",y:"number",width:"number",height:"number",standby_mode:"custom|top|left|right|bottom",standby_delay:"number",standby_easing:{default:{method:"ease",duration:"number"}}}}]}}};break;case"state_group":n={title:i,description:"State Group Description",conds:[{type:"property_bank|inner_state",key:"PROPERTY_BANK#<Data Node ID>|[current_canvas|BRICK_<OUTLET NAME>]|",method:"==|!=|>|>=|<|<=",value:"value_to_compare"}],override:{property:!1,event:!1,outlet:!1},commented:!1,break:!1,property:{},outlet:{},animation:{}};break;case"generator":var l=j(W.generatorMapping[t]);if(!l)throw Error(`Generator ${t} not found`);n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(l.propTypes).map(([e,i])=>[e,{...i,description:l.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(l.eventTypes).map(([e])=>[e,{description:l.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(l.outletTypes).map(([e])=>[e,{description:l.brickOutletDescriptions[e]}]))}};break;case"animation":n={title:i,type:"timing|decay|spring",property:"opacity|transform.translateX|transform.scale|etc",config:{$note:"Config for the animation"},compose_type:"parallel|sequence",item_list:[{animation_id:"ANIMATION_<SUB ANIMATION UUID>"}]};break;case"property_bank":n={title:i,description:"Property Bank Description",linkedFrom:"SUBSPACE_<UUID WHICH IS CROSS SUBSPACE>",type:"string|number|bool|object|array|any",kind:"color|datetime|id|media-resource-*|lottie-file-uri",unit:"grid|px|ms",routing:"read-only|default",value:"fit-to-type",event_map:{$note:`Available events: ${Object.keys(W.qJ.eventTypes).join(", ")}`},local_sync:{update_mode:"all|main-only|minor-only|dont-sync"},$remote_update_additional:{$note:"Configure remote update behavior",enable_remote_update:!0,bank_type:"create|create-device-specific"}};break;case"property_bank_command":break;case"property_bank_calc":var p=(0,tL.M4)("property_bank_command"),u=(0,tL.M4)("property_bank_command"),m=(0,tL.M4)("property_bank_command"),_="const { arg_name } = inputs;\n\nreturn { arg_name };";n={title:i,map:{$note:"Required, actual implementation","PROPERTY_BANK_DATA_NODE_<UUID>":{type:"data-node",properties:{},in:{change:null},out:{value:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID>",port:"value"}]},$note:"Use this to input data to the sandbox"},"PROPERTY_BANK_COMMAND_NODE_<UUID FIRST>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:null,path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},"PROPERTY_BANK_COMMAND_NODE_<UUID SECOND>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PREVIOUS>",port:"result"}],path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID SECOND>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},[p]:{type:"command-node-sandbox",title:"Command: SANDBOX_RUN_JAVASCRIPT",properties:{command:"SANDBOX_RUN_JAVASCRIPT",args:{code:_,enable_async:!1}},in:{code:null,inputs:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID FINAL>",port:"result"}]},out:{result:[{id:m,port:"result"},{id:u,port:"result"}]}},[m]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_ERROR",properties:{command:"SANDBOX_GET_ERROR"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR>",port:"change"}],$note:"Set `result` as null if there is no error"}},[u]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_RETURN_VALUE",properties:{command:"SANDBOX_GET_RETURN_VALUE"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT> | null",port:"change"}]}},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT>":{type:"data-node",properties:{},in:{change:[{id:u,port:"result"}]},out:{value:null},$note:"Put full result into data node"},"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>":{type:"command-node-object",title:"Command: OBJECT_GET",properties:{command:"OBJECT_GET",args:{path:"obj_key"}},in:{obj:[{id:u,port:"obj"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>",port:"change"}]},$note:"Parse result object into data node"},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>":{type:"data-node",properties:{},in:{change:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>",port:"result"}]},out:{value:null},$note:"Put partial result into data node"}},editor_info:{},type:"script",script_config:{title:i,enable_async:!1,inputs:{"PROPERTY_BANK_DATA_NODE_<UUID>":"arg_name"},disabled_triggers:{},error:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR> | null",output:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | null",outputs:{obj_key:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>"},code:_,$note:"Required, info for GUI editor"}}}return C({id:o,example:n,extraInfo:a})};var tH="2.25.0-beta.52";function tJ(){return tX.apply(this,arguments)}function tX(){return(tX=$(function*(e={}){var i,t=e.token||process.env.BRICKS_API_TOKEN;if(!t)throw console.error("Error: API token is required"),console.error("Please provide a token via options or set BRICKS_API_TOKEN environment variable"),Error("API token is required");var n=function(e){try{var i=e.queryStringParameters?.token;if(!i){var t=new Headers(e.headers);i=t.get("authorization")?.replace("Bearer ","")}if(!i)return{success:!1,message:"Authentication failed: No token provided"};var n=function(e){try{var i=e.split(".");if(i.length<3)return null;var t=JSON.parse(Buffer.from(i[0],"base64url").toString());if(!k.includes(t?.alg))return null;return JSON.parse(Buffer.from(i[1],"base64url").toString())}catch{return null}}(i);if(!n)return{success:!1,message:"Authentication failed: Invalid token"};var a=D.includes(n.iss)?"user":"workspace";if("workspace"===a){var o=Array.isArray(n.t)?n.t:[];n.permissions=o.reduce((e,i)=>{var t=I[i];return t&&e.push(t),e},[])}else n.permissions=Object.keys(b);return{success:!0,token:i,tokenInfo:n,tokenType:a}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}({queryStringParameters:{token:t}});if(!n.success)throw console.error("Error: Invalid BRICKS_API_TOKEN"),console.error(n.message),Error("Invalid BRICKS_API_TOKEN");var a=new v._({name:tY,version:tH}),o={...n,client:function(e,i,t){switch(t){case"user":return new iB(e,i);case"workspace":return new i3(e,i);default:throw Error(`Invalid token type: ${t}.`)}}(tG.bricks,n.token,n.tokenType)};a.prompt("getting-started","Getting started with BRICKS",{},$(function*(){return{messages:[{role:"user",content:{type:"text",text:`Welcome to BRICKS — start here.
|
|
2475
|
+
`,tK=z(function e(i,t){H(this,e),this.baseUrl=i,this.token=t,this.graphqlUrl=`${i}/api/graphql`},[{key:"graphql",value:(o=$(function*(e,i){var t=yield(0,x.Ay)(this.graphqlUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.token}`,Accept:"application/json"},body:JSON.stringify({query:e,variables:i})});if(!t.ok){var n=yield t.text().catch(()=>"");throw Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return o.apply(this,arguments)})},{key:"events",value:(r=$(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql(tj,{filter:n})).events}),function(e){return r.apply(this,arguments)})},{key:"screenshots",value:(s=$(function*(e){return(yield this.graphql(tV,{filter:e})).screenshots}),function(e){return s.apply(this,arguments)})},{key:"downloadScreenshot",value:(d=$(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,x.Ay)(n,{headers:{Authorization:`Bearer ${this.token}`}});if(!a.ok){var o=yield a.text().catch(()=>"");throw Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from((yield a.arrayBuffer()))}),function(e,i,t){return d.apply(this,arguments)})}]);process.env.STAGE,process.env.URL_BASE;var tY="bricks-mcp",tG={bricks:process.env.BRICKS_API_SERVER||"https://display-beta.bricks.tools",media:process.env.MEDIA_API_SERVER||"https://media-beta.bricks.tools",activityLog:process.env.ACTIVITY_LOG_API_SERVER||"https://activity-log-beta.bricks.tools"};process.env.AUTH0_DOMAIN,process.env.CACHE_URL;var tL=t(1639);let tz=({type:e,title:i,template_key:t})=>{var n,a,o=(0,tL.M4)(e);switch(e){case"subspace":n={title:i,layout:{width:"number",height:"number"},root_canvas_id:"CANVAS_<UUID>",canvas_map:{},brick_map:{},animation_map:{},generator_map:{},property_bank_map:{},property_bank_calc_map:{}},a={"canvas_map.CANVAS_<UUID>.item_list":[{type:"subspace",subspace_id:"SUBSPACE_<UUID>",$note:"If not a root subspace, it can be linked to canvas in other subspace"}]};break;case"canvas":var r=j(W.Ji);n={title:i,item_list:[],property:{$definitions:Object.fromEntries(Object.entries(r.propTypes).map(([e,i])=>[e,{...i,description:r.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(r.eventTypes).map(([e])=>[e,{description:r.brickEventDescriptions[e]}]))}},a={property_bank_map:{[(0,tL.M4)("property_bank")]:{title:`Canvas ID: ${i}`,type:"string",value:o,routing:"read-only",kind:"auto-generated-item-id",idType:"canvas"}}};break;case"brick":var s=j(W.dK.Basic),d=j(W.brickMapping[t]);if(!d)throw Error(`Brick ${t} not found`);var c={...d,propTypes:{...s.propTypes,...d.propTypes},brickPropDescriptions:{...s.brickPropDescriptions,...d.brickPropDescriptions},eventTypes:{...s.eventTypes,...d.eventTypes},brickEventDescriptions:{...s.brickEventDescriptions,...d.brickEventDescriptions}};n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(c.propTypes).map(([e,i])=>[e,{...i,description:c.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(c.eventTypes).map(([e])=>[e,{description:c.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(c.outletTypes).map(([e])=>[e,{description:c.brickOutletDescriptions[e]}]))},state_group:{"BRICK_STATE_GROUP_<UUID>":{}}},a={canvas_map:{"CANVAS_<UUID WHICH NEED DISPLAY THIS BRICK>":{item_list:[{type:"brick",brick_id:o,frame:{x:"number",y:"number",width:"number",height:"number",standby_mode:"custom|top|left|right|bottom",standby_delay:"number",standby_easing:{default:{method:"ease",duration:"number"}}}}]}}};break;case"state_group":n={title:i,description:"State Group Description",conds:[{type:"property_bank|inner_state",key:"PROPERTY_BANK#<Data Node ID>|[current_canvas|BRICK_<OUTLET NAME>]|",method:"==|!=|>|>=|<|<=",value:"value_to_compare"}],override:{property:!1,event:!1,outlet:!1},commented:!1,break:!1,property:{},outlet:{},animation:{}};break;case"generator":var l=j(W.generatorMapping[t]);if(!l)throw Error(`Generator ${t} not found`);n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(l.propTypes).map(([e,i])=>[e,{...i,description:l.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(l.eventTypes).map(([e])=>[e,{description:l.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(l.outletTypes).map(([e])=>[e,{description:l.brickOutletDescriptions[e]}]))}};break;case"animation":n={title:i,type:"timing|decay|spring",property:"opacity|transform.translateX|transform.scale|etc",config:{$note:"Config for the animation"},compose_type:"parallel|sequence",item_list:[{animation_id:"ANIMATION_<SUB ANIMATION UUID>"}]};break;case"property_bank":n={title:i,description:"Property Bank Description",linkedFrom:"SUBSPACE_<UUID WHICH IS CROSS SUBSPACE>",type:"string|number|bool|object|array|any",kind:"color|datetime|id|media-resource-*|lottie-file-uri",unit:"grid|px|ms",routing:"read-only|default",value:"fit-to-type",event_map:{$note:`Available events: ${Object.keys(W.qJ.eventTypes).join(", ")}`},local_sync:{update_mode:"all|main-only|minor-only|dont-sync"},$remote_update_additional:{$note:"Configure remote update behavior",enable_remote_update:!0,bank_type:"create|create-device-specific"}};break;case"property_bank_command":break;case"property_bank_calc":var p=(0,tL.M4)("property_bank_command"),u=(0,tL.M4)("property_bank_command"),m=(0,tL.M4)("property_bank_command"),_="const { arg_name } = inputs;\n\nreturn { arg_name };";n={title:i,map:{$note:"Required, actual implementation","PROPERTY_BANK_DATA_NODE_<UUID>":{type:"data-node",properties:{},in:{change:null},out:{value:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID>",port:"value"}]},$note:"Use this to input data to the sandbox"},"PROPERTY_BANK_COMMAND_NODE_<UUID FIRST>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:null,path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},"PROPERTY_BANK_COMMAND_NODE_<UUID SECOND>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PREVIOUS>",port:"result"}],path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID SECOND>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},[p]:{type:"command-node-sandbox",title:"Command: SANDBOX_RUN_JAVASCRIPT",properties:{command:"SANDBOX_RUN_JAVASCRIPT",args:{code:_,enable_async:!1}},in:{code:null,inputs:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID FINAL>",port:"result"}]},out:{result:[{id:m,port:"result"},{id:u,port:"result"}]}},[m]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_ERROR",properties:{command:"SANDBOX_GET_ERROR"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR>",port:"change"}],$note:"Set `result` as null if there is no error"}},[u]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_RETURN_VALUE",properties:{command:"SANDBOX_GET_RETURN_VALUE"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT> | null",port:"change"}]}},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT>":{type:"data-node",properties:{},in:{change:[{id:u,port:"result"}]},out:{value:null},$note:"Put full result into data node"},"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>":{type:"command-node-object",title:"Command: OBJECT_GET",properties:{command:"OBJECT_GET",args:{path:"obj_key"}},in:{obj:[{id:u,port:"obj"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>",port:"change"}]},$note:"Parse result object into data node"},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>":{type:"data-node",properties:{},in:{change:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>",port:"result"}]},out:{value:null},$note:"Put partial result into data node"}},editor_info:{},type:"script",script_config:{title:i,enable_async:!1,inputs:{"PROPERTY_BANK_DATA_NODE_<UUID>":"arg_name"},disabled_triggers:{},error:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR> | null",output:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | null",outputs:{obj_key:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>"},code:_,$note:"Required, info for GUI editor"}}}return C({id:o,example:n,extraInfo:a})};var tH="2.25.0-beta.53";function tJ(){return tX.apply(this,arguments)}function tX(){return(tX=$(function*(e={}){var i,t=e.token||process.env.BRICKS_API_TOKEN;if(!t)throw console.error("Error: API token is required"),console.error("Please provide a token via options or set BRICKS_API_TOKEN environment variable"),Error("API token is required");var n=function(e){try{var i=e.queryStringParameters?.token;if(!i){var t=new Headers(e.headers);i=t.get("authorization")?.replace("Bearer ","")}if(!i)return{success:!1,message:"Authentication failed: No token provided"};var n=function(e){try{var i=e.split(".");if(i.length<3)return null;var t=JSON.parse(Buffer.from(i[0],"base64url").toString());if(!k.includes(t?.alg))return null;return JSON.parse(Buffer.from(i[1],"base64url").toString())}catch{return null}}(i);if(!n)return{success:!1,message:"Authentication failed: Invalid token"};var a=D.includes(n.iss)?"user":"workspace";if("workspace"===a){var o=Array.isArray(n.t)?n.t:[];n.permissions=o.reduce((e,i)=>{var t=I[i];return t&&e.push(t),e},[])}else n.permissions=Object.keys(b);return{success:!0,token:i,tokenInfo:n,tokenType:a}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}({queryStringParameters:{token:t}});if(!n.success)throw console.error("Error: Invalid BRICKS_API_TOKEN"),console.error(n.message),Error("Invalid BRICKS_API_TOKEN");var a=new v._({name:tY,version:tH}),o={...n,client:function(e,i,t){switch(t){case"user":return new iB(e,i);case"workspace":return new i3(e,i);default:throw Error(`Invalid token type: ${t}.`)}}(tG.bricks,n.token,n.tokenType)};a.prompt("getting-started","Getting started with BRICKS",{},$(function*(){return{messages:[{role:"user",content:{type:"text",text:`Welcome to BRICKS — start here.
|
|
2476
2476
|
|
|
2477
2477
|
Before doing any complex work (application design, deployments, etc.),
|
|
2478
2478
|
always consult the official docs rather than guessing.
|
package/lib/511.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const __rspack_esm_id=511;export const __rspack_esm_ids=[511];export const __webpack_modules__={18501(e,t,r){let{docs:a}=r(5867);t.isCommand=e=>!!(e&&e.type&&e.type.startsWith("command-node-")),t.getPorts=e=>e?Array.isArray(e)?e:[e]:[],t.getCommandCallbackFromPort=(e,r)=>{let i=e[r];if(!t.isCommand(i))return null;let n=a[i.type.replace("command-node-","")]?.commands?.[i.properties?.command];return n?.iterateeFrom||n?.invocationFrom||null},t.checkDisableTriggerCommand=(e,r)=>t.getPorts(e[r.id]?.in?.[r.port]).some(e=>e?.disable_trigger_command),t.findCircularReferenceIds=e=>{let r,a=(r=new Map,Object.keys(e).reduce((a,i)=>{let n=[];return Object.values(e[i]?.out||{}).forEach(a=>{t.getPorts(a).forEach(a=>{((e,r,a)=>{var i;return!!r&&!!e[r.id]&&!(r.port===(i=r.id,a.has(i)||a.set(i,t.getCommandCallbackFromPort(e,i)),a.get(i))||t.checkDisableTriggerCommand(e,r))})(e,a,r)&&n.push(a.id)})}),a[i]=n,a},{})),i=new Map;return Object.keys(e).filter(t=>e[t]?.type==="data-node").filter(e=>((e,t,r)=>{if(r.has(e))return r.get(e);let a=[{id:e,edgeIndex:0,reachesCycle:!1}],i=new Set([e]);for(;a.length>0;){let e=a[a.length-1],n=t[e.id]||[];if(e.reachesCycle||e.edgeIndex>=n.length){i.delete(e.id),r.set(e.id,e.reachesCycle),a.pop(),e.reachesCycle&&a.length>0&&(a[a.length-1].reachesCycle=!0);continue}let s=n[e.edgeIndex];if(e.edgeIndex+=1,r.has(s)){r.get(s)&&(e.reachesCycle=!0);continue}if(i.has(s)){e.reachesCycle=!0;continue}i.add(s),a.push({id:s,edgeIndex:0,reachesCycle:!1})}return r.get(e)||!1})(e,a,i))},t.hasCircularReference=e=>t.findCircularReferenceIds(e).length>0,t.composeMap=e=>Object.values(e).reduce((e,r)=>Object.entries(r?.map||{}).reduce((e,[r,a])=>{if(e[r]){if(t.isCommand(a))throw Error(`Doesn't allow same command id in another map, ${r}`);let i=e[r];Object.keys(a?.in||{}).forEach(e=>{a.in[e]&&(i.in[e]=(i.in[e]||[]).concat(a.in[e]).filter(Boolean))}),Object.keys(a?.out||{}).forEach(e=>{a.out[e]&&(i.out[e]=(i.out[e]||[]).concat(a.out[e]).filter(Boolean))})}else e[r]={...a,in:{...a?.in},out:{...a?.out}};return e},e),{})},86343(e,t,r){let{v4:a}=r(45620),i=r(95479),{nameMap:n,brickMapping:s,generatorMapping:o}=r(63981);t.idByItem=(e={})=>e.canvas_id||e.subspace_id||e.brick_id||e.generator_id||e.property_bank_id||e.property_bank_calc_id||e.bank_id||e.scene_id,t.getAnimationType=e=>e.type||e.compose_type||e.composeType,t.cleanUpAnimationMap=e=>Object.entries(e).reduce((e,[t,r])=>((r.type||r.compose_type)&&(e[t]=r),e),{}),t.matchItemByItem=(e,t)=>{let r;if(!e)return!1;switch("string"==typeof t&&(r=t),e.type){case"brick":return e.brick_id===(r||t.brick_id);case"subspace":return e.subspace_id===(r||t.subspace_id);case"canvas":return e.canvas_id===(r||t.canvas_id);case"generator":return e.generator_id===(r||t.generator_id);case"property_bank":return e.property_bank_id===(r||t.property_bank_id);default:return!1}},t.makePasscode=()=>a(),t.kindOneOfTypes={string:["color","datetime","id","graphql","rich-text-content","sandbox-script","llm-prompt","media-resource-image","media-resource-video","media-resource-audio","media-resource-file","lottie-file-uri","rive-file-uri","ggml-model-asset","gguf-model-asset","mlx-model-asset","binary-asset","scene3d-objects"],number:["unit"],object:["tts-speaker-config"],"array-object":["llm-tools","llm-messages","mcp-server-resources","mcp-server-tools","mcp-server-prompts"]},t.getKindOneOfTypes=(e,r)=>"array"===e?"object"===r?t.kindOneOfTypes[`${e}-${r}`]:void 0:t.kindOneOfTypes[e],t.unitOneOfTypes=["grid","px","ms"],t.idOneOfTypes=["canvas","brick","generator","animation","property_bank"],t.typeToName={brick:"Brick",generator:"Generator",subspace:"Subspace",canvas:"Canvas",animation:"Animation",property_bank:"Data",property_bank_calc:"Calculation"},t.getBrickName=(e,r,a)=>{let s;if(!r)return e.toUpperCase();if(r.title)return r.title;switch(e){case"bank":s="BANK";break;case"subspace":s="SUBSPACE";break;case"canvas":s="CANVAS";break;case"animation":s=`<${i(t.getAnimationType(r))}>`;break;case"property_bank":s="<Data>";break;case"property_bank_calc":s="<Map>";break;case"state_group":s="<Switch Case>";break;default:s=`<${n[r.template_key||r.templateKey]||"Unknown"}>`}return a&&a.length>10?s+=` (${a.replace(/[A-Z_]+/g,"").substr(0,6)}...)`:a&&(s+=` (${a})`),s},t.getCallInternalActions=e=>{let t=s[e]||o[e];if(t)return t.callInternalActions},t.mapToList=(e,r)=>Object.entries(r).reduce((r,[a,i])=>(r.push({id:a,...i,title:t.getBrickName(e,i,a)}),r),[]);let c={subspaceMap:"subspace",brickMap:"brick",generatorMap:"generator",propertyBankMap:"property_bank",propertyAvailableToAdd:"property_bank",canvasMap:"canvas",animationMap:"animation"},l={};t.mapToListForDerivedState=(e,r,a,i)=>{let n=a[e]||l;return n!==i[e]?{[e]:n,[r]:t.mapToList(c[e],n)}:{}},t.arrayTypePrefix="array of ",t.propertyBankTypes=["string","number","bool","object","any",`${t.arrayTypePrefix}string`,`${t.arrayTypePrefix}number`,`${t.arrayTypePrefix}bool`,`${t.arrayTypePrefix}object`],t.animationRunTypes=["once","loop"],t.stopPropagationOnKeyBackspace=e=>{8===e.keyCode&&e.stopPropagation()},t.nestedTypes=["object","array","any"],t.isPropertyBankTypeNested=e=>t.nestedTypes.includes(e),t.propertyTypeToSchema=e=>{let r=e.indexOf(t.arrayTypePrefix)>-1,a=e.replace(t.arrayTypePrefix,"");return{type:a,properties:"object"===a?{}:void 0,allowNewItem:r,allowCustomProperty:"object"===a}}},37517(e,t,r){let{composeMap:a,findCircularReferenceIds:i}=r(18501);e.exports=function(e){let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{if(r.module?.link)return;let n=r.property_bank_calc_map;if(!n||0===Object.keys(n).length)return;let s=`subspace_map.${e}.property_bank_calc_map`;try{let e=a(n),r=i(e);if(r.length>0){let a=r.slice(0,5).map(t=>e[t].title||t),i=r.length>5?` and ${r.length-5} more`:"";t.push({field:s,message:`Circular reference detected in data calculation. Affected nodes: ${a.join(", ")}${i}. Please check the data connections for loops.`})}}catch(e){t.push({field:s,message:e.message})}}),t}},78078(e,t,r){let{parse:a}=r(89236),i={ecmaVersion:2020,allowReturnOutsideFunction:!0},n=(e,t,r)=>{if(e&&"object"==typeof e){if(Array.isArray(e))return void e.forEach((e,a)=>n(e,`${t}[${a}]`,r));Object.entries(e).forEach(([e,s])=>{("event_map"===e||"eventMap"===e)&&s&&"object"==typeof s?Object.entries(s).forEach(([n,s])=>{Array.isArray(s)&&s.forEach((s,o)=>{if(s?.action!=="PROPERTY_BANK_EXPRESSION")return;let c=(e=>{let t=e.parameter_list||e.parameterList||[];if(!Array.isArray(t))return;let r=t.find(e=>"EXPRESSION"===(e?.input_to_receiver||e?.inputToReceiver));return r?r.result_from_sender??r.resultFromSender:void 0})(s);if("string"!=typeof c||c.startsWith("PROPERTY_BANK#"))return;let l=(e=>{let t;if(!e.trim())return"Expression is empty";try{t=a(e,i)}catch(e){return`Expression does not parse: ${e.message}`}let r=(e=>{for(let t=0;t<e.length;t+=1){let r=e[t];if("ExpressionStatement"!==r.type){if("VariableDeclaration"===r.type){if(r.declarations.some(e=>"Identifier"!==e.id.type||!e.init))return"a variable declaration with destructuring or no initializer";continue}if(t!==e.length-1||"ReturnStatement"!==r.type)return`an unsupported ${r.type}`}}return null})(t.body);return r?`Expression contains ${r}; statements must fold into a single expression (expression statements, simple const/let declarations, and a final return only). Use ternaries instead of if/for/while, or move branching logic to a DataCalculationScript.`:null})(c);l&&r.push({field:`${t}.${e}.${n}[${o}]`,message:l})})}):s&&"object"==typeof s&&n(s,`${t}.${e}`,r)})}};e.exports=function(e){let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{r.module?.link||n(r,`subspace_map.${e}`,t)}),t}},38890(e,t,r){let{getDocByTemplateKey:a}=r(63981),i=r(80211),n=r(45907),s=r(37517),o=r(78078),{lintConfig:c,lintRuleCodes:l}=r(9098),{getBrickName:d}=r(86343);t.lintConfig=c,t.lintRuleCodes=l,t.checkConfigDeprecatedFeatures=e=>{let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{Object.entries(r.brick_map||{}).forEach(([i,n])=>{(void 0!==n.property?.borderLeftWidth||void 0!==n.property?.borderRightWidth||void 0!==n.property?.borderTopWidth||void 0!==n.property?.borderBottomWidth)&&t.push({id:i,name:"Used Deprecated Feature",data:`In v2.16, we have been changed \`Border Width\` to \`Border Size\` (Unit \`px\` to \`grid\`). The \`${d("brick",n,i)}\` brick still used the border width. Please re-edit it to transfer to the new unit.`});let s=a(n.template_key);s?.brickMeta?.deprecated&&t.push({id:i,name:"Used Deprecated Feature",data:`The \`${d("brick",n,i)}\` brick in \`${d("subspace",r,e)}\` have been deprecated, it may not work in the future, please consider to remove it. If you can't see the item, please enable \`Show Deprecated Features\` in setting.`})}),Object.entries(r.generator_map||{}).forEach(([i,n])=>{let s=a(n.template_key);s?.brickMeta?.deprecated&&t.push({id:i,name:"Used Deprecated Feature",data:`The \`${d("brick",n,i)}\` brick in \`${d("subspace",r,e)}\` have been deprecated, it may not work in the future, please consider to remove it. If you can't see the item, please enable \`Show Deprecated Features\` in setting.`})})}),t},t.checkConfig=(e,t={})=>{let r={schema:i(e),ref:n(e,t),calc:t.checkCalc?s(e):[],expression:t.checkExpressions?o(e):[]};return r.valid=0===r.schema.length&&0===r.ref.length&&0===r.calc.length&&0===r.expression.length,r.message=r.schema.concat(r.ref).concat(r.calc).concat(r.expression).map(({instancePath:e,field:t,message:r})=>{let a=e||t;return a?`${a}: ${r}`:r}).join("\n"),r}},27899(e){let t=["x","y","width","height"],r=e=>"string"==typeof e&&e.startsWith("PROPERTY_BANK_"),a=/PROPERTY_BANK#(PROPERTY_BANK_[A-Za-z0-9_-]+)/g,i=/(?:BRICK|ANIMATION|SUBSPACE)_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/g,n=(e,t=new Set)=>{if("string"==typeof e){let r;for(a.lastIndex=0;r=a.exec(e);)t.add(r[1])}else Array.isArray(e)?e.forEach(e=>n(e,t)):e&&"object"==typeof e&&(r(e.id)&&t.add(e.id),Object.values(e).forEach(e=>n(e,t)));return t},s=(e,t)=>{if("string"==typeof e){let r;for(i.lastIndex=0;r=i.exec(e);)t.add(r[0])}else Array.isArray(e)?e.forEach(e=>s(e,t)):e&&"object"==typeof e&&Object.values(e).forEach(e=>s(e,t));return t},o=(e,t)=>{Object.entries(e.subspace_map||{}).forEach(([e,r])=>{!r||"object"!=typeof r||r.module?.link||t(e,r)})},c=[["brick_map","brick"],["generator_map","generator"],["property_bank_map","property_bank"],["canvas_map","canvas"]],l=(e,t,r)=>{c.forEach(([a,i])=>{Object.entries(t[a]||{}).forEach(([t,n])=>{Object.entries(n?.event_map||{}).forEach(([n,s])=>{Array.isArray(s)&&r({ownerType:i,ownerId:t,eventKey:n,list:s,path:`subspace_map.${e}.${a}.${t}.event_map.${n}`})})})})},d=(e,t)=>(e.parameter_list||[]).find(e=>e?.input_to_receiver===t)?.result_from_sender;e.exports={FRAME_KEYS:t,isBankNodeId:r,collectBankReads:n,forEachSubspace:o,forEachEventList:l,getParamValue:d,hasParamValue:(e,t)=>{let r=d(e,t);return null!=r&&""!==r},collectDynamicallyReferencedIds:e=>{let t=new Set;return o(e,(e,r)=>{l(e,r,({list:e})=>{e.forEach(e=>s(e?.parameter_list,t))})}),s(e.automation_map,t),s(e.test_map,t),t},frameIsNumeric:e=>!!e&&t.every(t=>"number"==typeof e[t]),framesAlmostEqual:(e,r,a=.01)=>t.every(t=>Math.abs(e[t]-r[t])<=a),frameContains:(e,t,r=.01)=>e.x<=t.x+r&&e.y<=t.y+r&&e.x+e.width>=t.x+t.width-r&&e.y+e.height>=t.y+t.height-r,framesIntersect:(e,t)=>!(e.x+e.width<=t.x||t.x+t.width<=e.x||e.y+e.height<=t.y||t.y+t.height<=e.y),getItemId:e=>e?.brick_id||e?.subspace_id||null,itemHasAnimations:e=>!!e?.animations&&Object.keys(e.animations).length>0}},9098(e,t,r){let{collectDynamicallyReferencedIds:a}=r(27899),i=[r(98632),r(84223),r(92260),r(96810),r(60760),r(40566),r(31172),r(59707),r(39425)],n=i.map(e=>e.code),s=e=>Array.isArray(e)?e:"string"==typeof e&&e?e.split(",").map(e=>e.trim()).filter(Boolean):null;e.exports={lintConfig:(e,t={})=>{let r,o=s(t.only),c=s(t.ignore),l=[...o||[],...c||[]].filter(e=>!n.includes(e));if(l.length>0)throw Error(`Unknown lint rule code(s): ${l.join(", ")}. Valid codes: ${n.join(", ")}`);if(!e||"object"!=typeof e)return[];let d=i.filter(e=>(!o||o.includes(e.code))&&(!c||!c.includes(e.code)));if(0===d.length)return[];let p={configType:"module"===t.configType?"module":"app",gridStep:"number"==typeof t.gridStep&&t.gridStep>0?t.gridStep:.5,get dynamicRefIds(){return r||(r=a(e)),r}},h=[];return d.forEach(t=>{try{t.check(e,p,e=>h.push({severity:t.severity,code:t.code,path:"",subspaceId:null,itemId:null,hint:null,...e}))}catch(e){h.push({severity:"warning",code:t.code,path:"",subspaceId:null,itemId:null,message:`Lint rule crashed: ${e.message}`,hint:null})}}),h},lintRuleCodes:n}},98632(e,t,r){let{composeMap:a}=r(18501),{forEachSubspace:i,forEachEventList:n,collectBankReads:s,isBankNodeId:o,getParamValue:c}=r(27899),l=(e,t)=>t.map(t=>c(e,t)).filter(o),d={PROPERTY_BANK:{waitable:!0,targets:e=>(e.parameter_list||[]).map(e=>e?.input_to_receiver).filter(o)},PROPERTY_BANK_EXPRESSION:{waitable:!0,targets:e=>l(e,["RESULT","ERROR_RESULT"])},PROPERTY_BANK_COMMAND:{waitable:!0,targets:(e,t)=>((e,t)=>{let r=t();if(!r)return[];let a=[],i=new Set,n=(e.parameter_list||[]).map(e=>e?.input_to_receiver).filter(o);for(let e=0;e<n.length;e+=1){let t=n[e];if(i.has(t))continue;i.add(t);let s=r[t];s&&Object.values(s.out||{}).forEach(e=>{(e||[]).forEach(e=>{e?.id&&(e.id.includes("DATA_NODE")&&a.push(e.id),n.push(e.id))})})}return a})(e,t)},STORAGE_RETRIEVE:{waitable:!0,targets:e=>l(e,["STORAGE_RETRIEVE_RESULT"])},OPEN_FILE:{waitable:!0,targets:e=>l(e,["SAVE_PROPERTY","SAVE_DETAIL_PROPERTY","ERROR_SAVE_PROPERTY"])},SAVE_UPDATE_SNAPSHOT:{waitable:!0,targets:e=>l(e,["SNAPSHOT_SAVE_RESULT","SNAPSHOT_ERROR_RESULT"])},TRIGGER_APPLICATION_FILTER:{waitable:!0,targets:e=>l(e,["RESULT","ERROR_RESULT"])},TAKE_SCREENSHOT:{waitable:!1,targets:e=>l(e,["TAKE_SCREENSHOT_SAVE_PROPERTY"])}},p=/(^|_)RESULT$|_SAVE_PROPERTY$/;e.exports={code:"data-update-race",severity:"warning",description:"A data node is written without wait_async and read by a later action in the same event",check(e,t,r){i(e,(e,t)=>{let i,c=()=>{if(void 0===i)try{i=a(t.property_bank_calc_map||{})}catch{i=null}return i};n(e,t,({path:t,list:a})=>{let i=new Map;a.forEach((a,n)=>{if(!a||"object"!=typeof a)return;if("SYSTEM"===a.handler&&"DELAY"===a.action)return void i.clear();let l=new Set;(a.parameter_list||[]).forEach(e=>s(e?.result_from_sender,l)),l.forEach(s=>{let o=i.get(s);o&&(r({path:`${t}.${n}`,subspaceId:e,itemId:s,message:`\`${s}\` is written by action #${o.index} (${o.action}) without waiting, then read by action #${n} (${a.action}) — the read can still see the previous value.`,hint:o.waitable?`Set \`wait_async: true\` on action #${o.index} (${o.action}).`:`${o.action} ignores \`wait_async\` for its data write — insert a SYSTEM DELAY action between the two, or move the read into the data node's value-change event.`}),i.delete(s))});let h=((e,t)=>{if("SYSTEM"===e.handler){let r=d[e.action];if(!r)return null;let a=r.targets(e,t);return a.length>0?{targets:a,waitable:r.waitable}:null}let r=(e.parameter_list||[]).filter(e=>"string"==typeof e?.input_to_receiver&&p.test(e.input_to_receiver)&&o(e.result_from_sender)).map(e=>e.result_from_sender);return r.length>0?{targets:r,waitable:!0}:null})(a,c);if(!h)return;let m=!0===a.wait_async&&h.waitable;h.targets.forEach(e=>{m?i.delete(e):i.set(e,{index:n,action:a.action,waitable:h.waitable})})})})})}}},39425(e,t,r){let{forEachSubspace:a,forEachEventList:i,getParamValue:n}=r(27899),s=new Set(["Math","Date","Object","Array","Number","String","Boolean","JSON","RegExp","Intl","isNaN","isFinite","parseInt","parseFloat"]);e.exports={code:"expression-global-variable",severity:"error",description:"A PROPERTY_BANK_EXPRESSION variable is named after a JS global and is silently ignored at runtime",check(e,t,r){a(e,(e,t)=>{i(e,t,({path:t,list:a})=>{a.forEach((a,i)=>{if(a?.handler!=="SYSTEM"||"PROPERTY_BANK_EXPRESSION"!==a.action)return;let o=n(a,"VARIABLES");Array.isArray(o)&&o.forEach(a=>{let n=a?.key;"string"==typeof n&&s.has(n)&&r({path:`${t}.${i}`,subspaceId:e,itemId:null,message:`Expression variable "${n}" is named after the JS global \`${n}\` and is silently ignored — the global takes precedence in the expression scope, so the bound value is never used.`,hint:`Rename the variable (e.g. "${n}Value") so the expression reads the bound value.`})})})})})}}},40566(e,t,r){let{forEachSubspace:a,forEachEventList:i,hasParamValue:n}=r(27899),s=[{action:"STORAGE_RETRIEVE",severity:"error",isMissing:e=>!n(e,"STORAGE_RETRIEVE_RESULT"),message:"STORAGE_RETRIEVE requires a STORAGE_RETRIEVE_RESULT parameter — without it the action throws at runtime.",hint:"Add a STORAGE_RETRIEVE_RESULT parameter pointing at a data node."},{action:"TAKE_SCREENSHOT",severity:"warning",isMissing:e=>!n(e,"TAKE_SCREENSHOT_SAVE_PROPERTY"),message:"TAKE_SCREENSHOT without TAKE_SCREENSHOT_SAVE_PROPERTY is silently skipped at runtime.",hint:"Add a TAKE_SCREENSHOT_SAVE_PROPERTY parameter pointing at a data node."},{action:"OPEN_FILE",severity:"warning",isMissing:e=>!n(e,"SAVE_PROPERTY")&&!n(e,"SAVE_DETAIL_PROPERTY"),message:"OPEN_FILE has no SAVE_PROPERTY / SAVE_DETAIL_PROPERTY — the picked file is discarded.",hint:"Add SAVE_PROPERTY (file uri) or SAVE_DETAIL_PROPERTY (file detail) parameters."},{action:"OPEN_URL",severity:"warning",isMissing:e=>!n(e,"URL"),message:"OPEN_URL has no URL parameter — the action does nothing.",hint:"Add a URL parameter."}];e.exports={code:"missing-result-param",severity:"warning",description:"An action is missing the parameter that receives or drives its effect",check(e,t,r){a(e,(e,t)=>{i(e,t,({path:t,list:a})=>{a.forEach((a,i)=>{if(a?.handler!=="SYSTEM")return;let n=s.find(e=>e.action===a.action);n&&n.isMissing(a)&&r({path:`${t}.${i}`,subspaceId:e,itemId:null,severity:n.severity,message:n.message,hint:n.hint})})})})}}},92260(e,t,r){let{forEachSubspace:a,frameIsNumeric:i,getItemId:n,FRAME_KEYS:s}=r(27899),o=["width","height"];e.exports={code:"off-grid-frame",severity:"warning",description:"Frame values should be multiples of the 0.5 grid step",check(e,t,r){let c=t.gridStep;a(e,(e,t)=>{Object.entries(t.canvas_map||{}).forEach(([t,a])=>{(Array.isArray(a?.item_list)?a.item_list:[]).forEach((a,l)=>{let d=a?.frame;if(!i(d))return;let p=s.filter(e=>{let t=d[e];return(!o.includes(e)||!(t<=c))&&Math.abs(t-Math.round(t/c)*c)>.001});0!==p.length&&r({path:`subspace_map.${e}.canvas_map.${t}.item_list.${l}.frame`,subspaceId:e,itemId:n(a),message:`Frame ${p.map(e=>`${e}=${d[e]}`).join(", ")} ${1===p.length?"is":"are"} not aligned to the ${c} grid step.`,hint:`Round frame values to multiples of ${c}.`})})})})}}},96810(e,t,r){let{forEachSubspace:a,frameIsNumeric:i,getItemId:n,itemHasAnimations:s}=r(27899);e.exports={code:"out-of-bounds-frame",severity:"warning",description:"An element is fully outside the subspace layout or has a non-positive size",check(e,t,r){a(e,(a,o)=>{let c=o.layout;"number"!=typeof c?.width||"number"!=typeof c?.height||c.width<=0||c.height<=0||Object.entries(o.canvas_map||{}).forEach(([o,l])=>{(Array.isArray(l?.item_list)?l.item_list:[]).forEach((l,d)=>{let p=l?.frame;if(!i(p)||!0===p.exceed_boundary||p.standby_frame||s(l))return;let h=n(l);if(h&&t.dynamicRefIds.has(h))return;let m=`subspace_map.${a}.canvas_map.${o}.item_list.${d}.frame`;if(p.width<=0||p.height<=0)return void r({path:m,subspaceId:a,itemId:h,message:`Frame has a non-positive size (width=${p.width}, height=${p.height}) — the element renders nothing.`,hint:"Give the element a positive size, or remove it if unused."});let u=a===e.root_subspace_id,f=p.x>=c.width||p.x+p.width<=0,_=p.y>=c.height||p.y+p.height<=0;(f||!u&&_)&&r({path:m,subspaceId:a,itemId:h,message:`Frame (x=${p.x}, y=${p.y}, width=${p.width}, height=${p.height}) is fully outside the ${c.width}\xd7${c.height} layout — nothing is visible.`,hint:"Move the element back into the layout, or set `exceed_boundary` if the placement is intentional."})})})})}}},84223(e,t,r){let{FRAME_KEYS:a,forEachSubspace:i,frameIsNumeric:n,framesAlmostEqual:s,framesIntersect:o,itemHasAnimations:c}=r(27899),l=new Set(["BRICK_TEXT","BRICK_RICH_TEXT"]),d=["linearGradientEnabled","blurEnabled"],p=/^backgroundColor$|^border/,h=(e,t)=>{if(e?.type!=="brick")return null;let r=t[e.brick_id];return l.has(r?.template_key)?r:null},m=e=>a.map(t=>Math.floor(e[t]/.01)),u=e=>e.join(":"),f=(e,t,r,a)=>{if(!n(t?.frame)||!h(t,r))return;let i=u(m(t.frame)),s=(e.get(i)||0)+a;s>0?e.set(i,s):e.delete(i)};e.exports={code:"redundant-rect-overlay",severity:"info",description:"A plain Rect behind a same-frame Text/RichText can be folded into the text brick",check(e,t,r){i(e,(e,a)=>{let i=a.brick_map||{};Object.entries(a.canvas_map||{}).forEach(([a,l])=>{let _,y=Array.isArray(l?.item_list)?l.item_list:[],b=(_=new Map,y.forEach(e=>f(_,e,i,1)),_);y.forEach((l,_)=>{if(f(b,l,i,-1),l?.type!=="brick"||!n(l.frame))return;let E=i[l.brick_id];if(E?.template_key!=="BRICK_RECT"||Object.values(E?.event_map||{}).some(e=>Array.isArray(e)&&e.length>0)||c(l)||t.dynamicRefIds.has(l.brick_id))return;let g={...E.property,...l.property};if(!d.some(e=>g[e])&&((e,t)=>{let[r,a,i,n]=m(t);for(let t=-1;t<=1;t+=1)for(let s=-1;s<=1;s+=1)for(let o=-1;o<=1;o+=1)for(let c=-1;c<=1;c+=1)if(e.has(u([r+t,a+s,i+o,n+c])))return!0;return!1})(b,l.frame))for(let t=_+1;t<y.length;t+=1){let c=y[t];if(!n(c?.frame))continue;let d=h(c,i);if(d&&s(l.frame,c.frame,.01)){let t={...d.property,...c.property};if(Object.keys(t).some(e=>p.test(e)&&void 0!==t[e]))return;r({path:`subspace_map.${e}.canvas_map.${a}.item_list.${_}`,subspaceId:e,itemId:l.brick_id,message:`Rect \`${E.title||l.brick_id}\` has the same frame as the ${d.template_key} above it and only uses base styles.`,hint:"Set backgroundColor / border / radius directly on the text brick and remove the Rect."});return}if(o(l.frame,c.frame))return}})})})}}},31172(e,t,r){let{autoGeneratedItemIdKind:a}=r(99470),{forEachSubspace:i}=r(27899),n="PROPERTY_BANK_",s=()=>({children:Object.create(null),ids:null});e.exports={code:"unused-data-node",severity:"info",description:"A data node is defined but never referenced anywhere in the config",check(e,t,r){let o=JSON.stringify(e),c=[];i(e,(r,i)=>{("module"!==t.configType||r!==e.root_subspace_id)&&Object.entries(i.property_bank_map||{}).forEach(([e,t])=>{!(!t||"object"!=typeof t||t.kind===a||t.enable_remote_update||t.global_remote_update_prop||t.linkedFrom||t.alias||t.preload||i.routing?.[e]?.enabled_routing)&&(Object.values(t?.event_map||{}).some(e=>Array.isArray(e)&&e.length>0)||c.push({subspaceId:r,nodeId:e,node:t}))})});let l=((e,t)=>{let r=[...new Set(t)];if(0===r.length)return new Map;let a=new Map(r.map(e=>[e,0])),i=s();r.forEach(e=>{let t=i;for(let r of e)t.children[r]||(t.children[r]=s()),t=t.children[r];t.ids||(t.ids=[]),t.ids.push(e)});let o=e.indexOf(n);for(;-1!==o;){let t=i;for(let r=o;r<e.length&&(t=t.children[e[r]]);r+=1)t.ids&&t.ids.forEach(e=>{a.set(e,a.get(e)+1)});o=e.indexOf(n,o+1)}return r.forEach(t=>{t.startsWith(n)||a.set(t,e.split(t).length-1)}),a})(o,c.map(({nodeId:e})=>e));c.forEach(({subspaceId:e,nodeId:t,node:a})=>{(l.get(t)||0)>1||r({path:`subspace_map.${e}.property_bank_map.${t}`,subspaceId:e,itemId:t,message:`Data node \`${a.title||t}\` is never referenced in the config.`,hint:"Remove it, or keep it if external tooling depends on it."})})}}},60760(e,t,r){let{forEachSubspace:a,forEachEventList:i}=r(27899),n=new Set(["MESSAGE","ALERT","POPUP_RESET","TAKE_SCREENSHOT","THROW_EXCEPTION","RESTART_FOUNDATION","DYNAMIC_BRICK","DYNAMIC_BRICK_RESET","DYNAMIC_ANIMATION","DYNAMIC_ANIMATION_RESET","DYNAMIC_ANIMATION_STOP","CHANNEL_SUBSCRIBE","CHANNEL_UNSUBSCRIBE","CHANNEL_PUBLISH","DISMISS_KEYBOARD","STORAGE_SET","STORAGE_DELETE","DELAY","USE_SHARE_APPLICATION","AUTH_IN_DEVICE","REFRESH_BINDCODE","STOP_APPLICATION_FILTER"]);e.exports={code:"wait-async-no-op",severity:"info",description:"wait_async is set on an action that ignores it",check(e,t,r){a(e,(e,t)=>{i(e,t,({path:t,list:a})=>{a.forEach((a,i)=>{a?.handler!=="SYSTEM"||!0!==a.wait_async||n.has(a.action)&&r({path:`${t}.${i}`,subspaceId:e,itemId:null,message:"DELAY"===a.action?"DELAY always waits for its timeout — `wait_async: true` is redundant.":`\`wait_async: true\` has no effect on ${a.action}; the action does not block the chain.`,hint:"DELAY"===a.action?"Remove the redundant flag.":"Remove the flag, or restructure if you relied on it for sequencing."})})})})}}},59707(e,t,r){let{forEachSubspace:a,frameIsNumeric:i,frameContains:n,itemHasAnimations:s}=r(27899);e.exports={code:"z-order-cover",severity:"info",description:"A later opaque element fully covers an earlier pressable element",check(e,t,r){a(e,(e,a)=>{let o=a.brick_map||{};Object.entries(a.canvas_map||{}).forEach(([a,c])=>{let l=Array.isArray(c?.item_list)?c.item_list:[],d=[];if(l.forEach((e,t)=>{if(e?.type!=="brick"||!i(e.frame))return;let r=o[e.brick_id];r&&Object.entries(r?.event_map||{}).some(([e,t])=>e.includes("_ON_PRESS")&&Array.isArray(t)&&t.length>0)&&d.push({item:e,index:t,brick:r})}),0===d.length)return;let p=t.dynamicRefIds,h=l.map((e,t)=>((e,t,r,a)=>{let n;if(e?.type!=="brick"||!i(e.frame)||s(e)||a.has(e.brick_id))return null;let o=r[e.brick_id],c={...o?.property,...e.property};return"string"==typeof(n=c.backgroundColor)&&(/^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*1(?:\.0+)?\s*\)$/.test(n)||/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/.test(n)||/^#[0-9a-fA-F]{6}$/.test(n))&&(void 0===c.opacity||1===c.opacity)?{index:t,item:e,brick:o,frame:e.frame}:null})(e,t,o,p)).filter(Boolean),m=0;d.forEach(({item:t,index:i,brick:o})=>{if(!(s(t)||p.has(t.brick_id))){for(;m<h.length&&h[m].index<=i;)m+=1;for(let s=m;s<h.length;s+=1){let c=h[s];if(n(c.frame,t.frame))return void r({path:`subspace_map.${e}.canvas_map.${a}.item_list.${i}`,subspaceId:e,itemId:t.brick_id,message:`Pressable \`${o.title||t.brick_id}\` is fully covered by the opaque \`${c.brick?.title||c.item.brick_id}\` later in the item list — it is invisible and untappable.`,hint:"Reorder the items, shrink the covering element, or remove the hidden one."})}}})})})}}}};
|
|
1
|
+
export const __rspack_esm_id=511;export const __rspack_esm_ids=[511];export const __webpack_modules__={18501(e,t,r){let{docs:a}=r(5867);t.isCommand=e=>!!(e&&e.type&&e.type.startsWith("command-node-")),t.getPorts=e=>e?Array.isArray(e)?e:[e]:[],t.getCommandCallbackFromPort=(e,r)=>{let i=e[r];if(!t.isCommand(i))return null;let n=a[i.type.replace("command-node-","")]?.commands?.[i.properties?.command];return n?.iterateeFrom||n?.invocationFrom||null},t.checkDisableTriggerCommand=(e,r)=>t.getPorts(e[r.id]?.in?.[r.port]).some(e=>e?.disable_trigger_command),t.findCircularReferenceIds=e=>{let r,a=(r=new Map,Object.keys(e).reduce((a,i)=>{let n=[];return Object.values(e[i]?.out||{}).forEach(a=>{t.getPorts(a).forEach(a=>{((e,r,a)=>{var i;return!!r&&!!e[r.id]&&!(r.port===(i=r.id,a.has(i)||a.set(i,t.getCommandCallbackFromPort(e,i)),a.get(i))||t.checkDisableTriggerCommand(e,r))})(e,a,r)&&n.push(a.id)})}),a[i]=n,a},{})),i=new Map;return Object.keys(e).filter(t=>e[t]?.type==="data-node").filter(e=>((e,t,r)=>{if(r.has(e))return r.get(e);let a=[{id:e,edgeIndex:0,reachesCycle:!1}],i=new Set([e]);for(;a.length>0;){let e=a[a.length-1],n=t[e.id]||[];if(e.reachesCycle||e.edgeIndex>=n.length){i.delete(e.id),r.set(e.id,e.reachesCycle),a.pop(),e.reachesCycle&&a.length>0&&(a[a.length-1].reachesCycle=!0);continue}let s=n[e.edgeIndex];if(e.edgeIndex+=1,r.has(s)){r.get(s)&&(e.reachesCycle=!0);continue}if(i.has(s)){e.reachesCycle=!0;continue}i.add(s),a.push({id:s,edgeIndex:0,reachesCycle:!1})}return r.get(e)||!1})(e,a,i))},t.hasCircularReference=e=>t.findCircularReferenceIds(e).length>0;let i=(e={})=>Object.entries(e).reduce((e,[t,r])=>(e[t]=Array.isArray(r)?r.slice():r,e),{}),n=new WeakSet,s=(e,t,r)=>{if(!r)return;let a=((e,t)=>{let r=e[t];if(!r)return e[t]=[],e[t];if(!Array.isArray(r))return e[t]=[r],e[t];if(!n.has(r)){let e=0;for(let t of r)t&&(r[e]=t,e+=1);r.length=e,n.add(r)}return r})(e,t);(Array.isArray(r)?r:[r]).forEach(e=>{e&&a.push(e)})};t.composeMap=e=>Object.values(e).reduce((e,r)=>Object.entries(r?.map||{}).reduce((e,[r,a])=>{if(e[r]){if(t.isCommand(a))throw Error(`Doesn't allow same command id in another map, ${r}`);let i=e[r];Object.keys(a?.in||{}).forEach(e=>{s(i.in,e,a.in[e])}),Object.keys(a?.out||{}).forEach(e=>{s(i.out,e,a.out[e])})}else e[r]={...a,in:i(a?.in),out:i(a?.out)};return e},e),{})},86343(e,t,r){let{v4:a}=r(45620),i=r(95479),{nameMap:n,brickMapping:s,generatorMapping:o}=r(63981);t.idByItem=(e={})=>e.canvas_id||e.subspace_id||e.brick_id||e.generator_id||e.property_bank_id||e.property_bank_calc_id||e.bank_id||e.scene_id,t.getAnimationType=e=>e.type||e.compose_type||e.composeType,t.cleanUpAnimationMap=e=>Object.entries(e).reduce((e,[t,r])=>((r.type||r.compose_type)&&(e[t]=r),e),{}),t.matchItemByItem=(e,t)=>{let r;if(!e)return!1;switch("string"==typeof t&&(r=t),e.type){case"brick":return e.brick_id===(r||t.brick_id);case"subspace":return e.subspace_id===(r||t.subspace_id);case"canvas":return e.canvas_id===(r||t.canvas_id);case"generator":return e.generator_id===(r||t.generator_id);case"property_bank":return e.property_bank_id===(r||t.property_bank_id);default:return!1}},t.makePasscode=()=>a(),t.kindOneOfTypes={string:["color","datetime","id","graphql","rich-text-content","sandbox-script","llm-prompt","media-resource-image","media-resource-video","media-resource-audio","media-resource-file","lottie-file-uri","rive-file-uri","ggml-model-asset","gguf-model-asset","mlx-model-asset","binary-asset","scene3d-objects"],number:["unit"],object:["tts-speaker-config"],"array-object":["llm-tools","llm-messages","mcp-server-resources","mcp-server-tools","mcp-server-prompts"]},t.getKindOneOfTypes=(e,r)=>"array"===e?"object"===r?t.kindOneOfTypes[`${e}-${r}`]:void 0:t.kindOneOfTypes[e],t.unitOneOfTypes=["grid","px","ms"],t.idOneOfTypes=["canvas","brick","generator","animation","property_bank"],t.typeToName={brick:"Brick",generator:"Generator",subspace:"Subspace",canvas:"Canvas",animation:"Animation",property_bank:"Data",property_bank_calc:"Calculation"},t.getBrickName=(e,r,a)=>{let s;if(!r)return e.toUpperCase();if(r.title)return r.title;switch(e){case"bank":s="BANK";break;case"subspace":s="SUBSPACE";break;case"canvas":s="CANVAS";break;case"animation":s=`<${i(t.getAnimationType(r))}>`;break;case"property_bank":s="<Data>";break;case"property_bank_calc":s="<Map>";break;case"state_group":s="<Switch Case>";break;default:s=`<${n[r.template_key||r.templateKey]||"Unknown"}>`}return a&&a.length>10?s+=` (${a.replace(/[A-Z_]+/g,"").substr(0,6)}...)`:a&&(s+=` (${a})`),s},t.getCallInternalActions=e=>{let t=s[e]||o[e];if(t)return t.callInternalActions},t.mapToList=(e,r)=>Object.entries(r).reduce((r,[a,i])=>(r.push({id:a,...i,title:t.getBrickName(e,i,a)}),r),[]);let l={subspaceMap:"subspace",brickMap:"brick",generatorMap:"generator",propertyBankMap:"property_bank",propertyAvailableToAdd:"property_bank",canvasMap:"canvas",animationMap:"animation"},c={};t.mapToListForDerivedState=(e,r,a,i)=>{let n=a[e]||c;return n!==i[e]?{[e]:n,[r]:t.mapToList(l[e],n)}:{}},t.arrayTypePrefix="array of ",t.propertyBankTypes=["string","number","bool","object","any",`${t.arrayTypePrefix}string`,`${t.arrayTypePrefix}number`,`${t.arrayTypePrefix}bool`,`${t.arrayTypePrefix}object`],t.animationRunTypes=["once","loop"],t.stopPropagationOnKeyBackspace=e=>{8===e.keyCode&&e.stopPropagation()},t.nestedTypes=["object","array","any"],t.isPropertyBankTypeNested=e=>t.nestedTypes.includes(e),t.propertyTypeToSchema=e=>{let r=e.indexOf(t.arrayTypePrefix)>-1,a=e.replace(t.arrayTypePrefix,"");return{type:a,properties:"object"===a?{}:void 0,allowNewItem:r,allowCustomProperty:"object"===a}}},37517(e,t,r){let{composeMap:a,findCircularReferenceIds:i}=r(18501);e.exports=function(e){let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{if(r.module?.link)return;let n=r.property_bank_calc_map;if(!n||0===Object.keys(n).length)return;let s=`subspace_map.${e}.property_bank_calc_map`;try{let e=a(n),r=i(e);if(r.length>0){let a=r.slice(0,5).map(t=>e[t].title||t),i=r.length>5?` and ${r.length-5} more`:"";t.push({field:s,message:`Circular reference detected in data calculation. Affected nodes: ${a.join(", ")}${i}. Please check the data connections for loops.`})}}catch(e){t.push({field:s,message:e.message})}}),t}},78078(e,t,r){let{parse:a}=r(89236),i={ecmaVersion:2020,allowReturnOutsideFunction:!0},n=(e,t,r)=>{if(e&&"object"==typeof e){if(Array.isArray(e))return void e.forEach((e,a)=>n(e,`${t}[${a}]`,r));Object.entries(e).forEach(([e,s])=>{("event_map"===e||"eventMap"===e)&&s&&"object"==typeof s?Object.entries(s).forEach(([n,s])=>{Array.isArray(s)&&s.forEach((s,o)=>{if(s?.action!=="PROPERTY_BANK_EXPRESSION")return;let l=(e=>{let t=e.parameter_list||e.parameterList||[];if(!Array.isArray(t))return;let r=t.find(e=>"EXPRESSION"===(e?.input_to_receiver||e?.inputToReceiver));return r?r.result_from_sender??r.resultFromSender:void 0})(s);if("string"!=typeof l||l.startsWith("PROPERTY_BANK#"))return;let c=(e=>{let t;if(!e.trim())return"Expression is empty";try{t=a(e,i)}catch(e){return`Expression does not parse: ${e.message}`}let r=(e=>{for(let t=0;t<e.length;t+=1){let r=e[t];if("ExpressionStatement"!==r.type){if("VariableDeclaration"===r.type){if(r.declarations.some(e=>"Identifier"!==e.id.type||!e.init))return"a variable declaration with destructuring or no initializer";continue}if(t!==e.length-1||"ReturnStatement"!==r.type)return`an unsupported ${r.type}`}}return null})(t.body);return r?`Expression contains ${r}; statements must fold into a single expression (expression statements, simple const/let declarations, and a final return only). Use ternaries instead of if/for/while, or move branching logic to a DataCalculationScript.`:null})(l);c&&r.push({field:`${t}.${e}.${n}[${o}]`,message:c})})}):s&&"object"==typeof s&&n(s,`${t}.${e}`,r)})}};e.exports=function(e){let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{r.module?.link||n(r,`subspace_map.${e}`,t)}),t}},38890(e,t,r){let{getDocByTemplateKey:a}=r(63981),i=r(80211),n=r(45907),s=r(37517),o=r(78078),{lintConfig:l,lintRuleCodes:c}=r(9098),{getBrickName:d}=r(86343);t.lintConfig=l,t.lintRuleCodes=c,t.checkConfigDeprecatedFeatures=e=>{let t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{Object.entries(r.brick_map||{}).forEach(([i,n])=>{(void 0!==n.property?.borderLeftWidth||void 0!==n.property?.borderRightWidth||void 0!==n.property?.borderTopWidth||void 0!==n.property?.borderBottomWidth)&&t.push({id:i,name:"Used Deprecated Feature",data:`In v2.16, we have been changed \`Border Width\` to \`Border Size\` (Unit \`px\` to \`grid\`). The \`${d("brick",n,i)}\` brick still used the border width. Please re-edit it to transfer to the new unit.`});let s=a(n.template_key);s?.brickMeta?.deprecated&&t.push({id:i,name:"Used Deprecated Feature",data:`The \`${d("brick",n,i)}\` brick in \`${d("subspace",r,e)}\` have been deprecated, it may not work in the future, please consider to remove it. If you can't see the item, please enable \`Show Deprecated Features\` in setting.`})}),Object.entries(r.generator_map||{}).forEach(([i,n])=>{let s=a(n.template_key);s?.brickMeta?.deprecated&&t.push({id:i,name:"Used Deprecated Feature",data:`The \`${d("brick",n,i)}\` brick in \`${d("subspace",r,e)}\` have been deprecated, it may not work in the future, please consider to remove it. If you can't see the item, please enable \`Show Deprecated Features\` in setting.`})})}),t},t.checkConfig=(e,t={})=>{let r={schema:i(e),ref:n(e,t),calc:t.checkCalc?s(e):[],expression:t.checkExpressions?o(e):[]};return r.valid=0===r.schema.length&&0===r.ref.length&&0===r.calc.length&&0===r.expression.length,r.message=r.schema.concat(r.ref).concat(r.calc).concat(r.expression).map(({instancePath:e,field:t,message:r})=>{let a=e||t;return a?`${a}: ${r}`:r}).join("\n"),r}},27899(e){let t=["x","y","width","height"],r=e=>"string"==typeof e&&e.startsWith("PROPERTY_BANK_"),a=/PROPERTY_BANK#(PROPERTY_BANK_[A-Za-z0-9_-]+)/g,i=/(?:BRICK|ANIMATION|SUBSPACE)_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/g,n=(e,t=new Set)=>{if("string"==typeof e){let r;for(a.lastIndex=0;r=a.exec(e);)t.add(r[1])}else Array.isArray(e)?e.forEach(e=>n(e,t)):e&&"object"==typeof e&&(r(e.id)&&t.add(e.id),Object.values(e).forEach(e=>n(e,t)));return t},s=(e,t)=>{if("string"==typeof e){let r;for(i.lastIndex=0;r=i.exec(e);)t.add(r[0])}else Array.isArray(e)?e.forEach(e=>s(e,t)):e&&"object"==typeof e&&Object.values(e).forEach(e=>s(e,t));return t},o=(e,t)=>{Object.entries(e.subspace_map||{}).forEach(([e,r])=>{!r||"object"!=typeof r||r.module?.link||t(e,r)})},l=[["brick_map","brick"],["generator_map","generator"],["property_bank_map","property_bank"],["canvas_map","canvas"]],c=(e,t,r)=>{l.forEach(([a,i])=>{Object.entries(t[a]||{}).forEach(([t,n])=>{Object.entries(n?.event_map||{}).forEach(([n,s])=>{Array.isArray(s)&&r({ownerType:i,ownerId:t,eventKey:n,list:s,path:`subspace_map.${e}.${a}.${t}.event_map.${n}`})})})})},d=(e,t)=>(e.parameter_list||[]).find(e=>e?.input_to_receiver===t)?.result_from_sender;e.exports={FRAME_KEYS:t,isBankNodeId:r,collectBankReads:n,forEachSubspace:o,forEachEventList:c,getParamValue:d,hasParamValue:(e,t)=>{let r=d(e,t);return null!=r&&""!==r},collectDynamicallyReferencedIds:e=>{let t=new Set;return o(e,(e,r)=>{c(e,r,({list:e})=>{e.forEach(e=>s(e?.parameter_list,t))})}),s(e.automation_map,t),s(e.test_map,t),t},frameIsNumeric:e=>!!e&&t.every(t=>"number"==typeof e[t]),framesAlmostEqual:(e,r,a=.01)=>t.every(t=>Math.abs(e[t]-r[t])<=a),frameContains:(e,t,r=.01)=>e.x<=t.x+r&&e.y<=t.y+r&&e.x+e.width>=t.x+t.width-r&&e.y+e.height>=t.y+t.height-r,framesIntersect:(e,t)=>!(e.x+e.width<=t.x||t.x+t.width<=e.x||e.y+e.height<=t.y||t.y+t.height<=e.y),getItemId:e=>e?.brick_id||e?.subspace_id||null,itemHasAnimations:e=>!!e?.animations&&Object.keys(e.animations).length>0}},9098(e,t,r){let{collectDynamicallyReferencedIds:a}=r(27899),i=[r(98632),r(84223),r(92260),r(96810),r(60760),r(40566),r(31172),r(59707),r(39425)],n=i.map(e=>e.code),s=e=>Array.isArray(e)?e:"string"==typeof e&&e?e.split(",").map(e=>e.trim()).filter(Boolean):null;e.exports={lintConfig:(e,t={})=>{let r,o=s(t.only),l=s(t.ignore),c=[...o||[],...l||[]].filter(e=>!n.includes(e));if(c.length>0)throw Error(`Unknown lint rule code(s): ${c.join(", ")}. Valid codes: ${n.join(", ")}`);if(!e||"object"!=typeof e)return[];let d=i.filter(e=>(!o||o.includes(e.code))&&(!l||!l.includes(e.code)));if(0===d.length)return[];let p={configType:"module"===t.configType?"module":"app",gridStep:"number"==typeof t.gridStep&&t.gridStep>0?t.gridStep:.5,get dynamicRefIds(){return r||(r=a(e)),r}},h=[];return d.forEach(t=>{try{t.check(e,p,e=>h.push({severity:t.severity,code:t.code,path:"",subspaceId:null,itemId:null,hint:null,...e}))}catch(e){h.push({severity:"warning",code:t.code,path:"",subspaceId:null,itemId:null,message:`Lint rule crashed: ${e.message}`,hint:null})}}),h},lintRuleCodes:n}},98632(e,t,r){let{composeMap:a}=r(18501),{forEachSubspace:i,forEachEventList:n,collectBankReads:s,isBankNodeId:o,getParamValue:l}=r(27899),c=(e,t)=>t.map(t=>l(e,t)).filter(o),d={PROPERTY_BANK:{waitable:!0,targets:e=>(e.parameter_list||[]).map(e=>e?.input_to_receiver).filter(o)},PROPERTY_BANK_EXPRESSION:{waitable:!0,targets:e=>c(e,["RESULT","ERROR_RESULT"])},PROPERTY_BANK_COMMAND:{waitable:!0,targets:(e,t)=>((e,t)=>{let r=t();if(!r)return[];let a=[],i=new Set,n=(e.parameter_list||[]).map(e=>e?.input_to_receiver).filter(o);for(let e=0;e<n.length;e+=1){let t=n[e];if(i.has(t))continue;i.add(t);let s=r[t];s&&Object.values(s.out||{}).forEach(e=>{(e||[]).forEach(e=>{e?.id&&(e.id.includes("DATA_NODE")&&a.push(e.id),n.push(e.id))})})}return a})(e,t)},STORAGE_RETRIEVE:{waitable:!0,targets:e=>c(e,["STORAGE_RETRIEVE_RESULT"])},OPEN_FILE:{waitable:!0,targets:e=>c(e,["SAVE_PROPERTY","SAVE_DETAIL_PROPERTY","ERROR_SAVE_PROPERTY"])},SAVE_UPDATE_SNAPSHOT:{waitable:!0,targets:e=>c(e,["SNAPSHOT_SAVE_RESULT","SNAPSHOT_ERROR_RESULT"])},TRIGGER_APPLICATION_FILTER:{waitable:!0,targets:e=>c(e,["RESULT","ERROR_RESULT"])},TAKE_SCREENSHOT:{waitable:!1,targets:e=>c(e,["TAKE_SCREENSHOT_SAVE_PROPERTY"])}},p=/(^|_)RESULT$|_SAVE_PROPERTY$/;e.exports={code:"data-update-race",severity:"warning",description:"A data node is written without wait_async and read by a later action in the same event",check(e,t,r){i(e,(e,t)=>{let i,l=()=>{if(void 0===i)try{i=a(t.property_bank_calc_map||{})}catch{i=null}return i};n(e,t,({path:t,list:a})=>{let i=new Map;a.forEach((a,n)=>{if(!a||"object"!=typeof a)return;if("SYSTEM"===a.handler&&"DELAY"===a.action)return void i.clear();let c=new Set;(a.parameter_list||[]).forEach(e=>s(e?.result_from_sender,c)),c.forEach(s=>{let o=i.get(s);o&&(r({path:`${t}.${n}`,subspaceId:e,itemId:s,message:`\`${s}\` is written by action #${o.index} (${o.action}) without waiting, then read by action #${n} (${a.action}) — the read can still see the previous value.`,hint:o.waitable?`Set \`wait_async: true\` on action #${o.index} (${o.action}).`:`${o.action} ignores \`wait_async\` for its data write — insert a SYSTEM DELAY action between the two, or move the read into the data node's value-change event.`}),i.delete(s))});let h=((e,t)=>{if("SYSTEM"===e.handler){let r=d[e.action];if(!r)return null;let a=r.targets(e,t);return a.length>0?{targets:a,waitable:r.waitable}:null}let r=(e.parameter_list||[]).filter(e=>"string"==typeof e?.input_to_receiver&&p.test(e.input_to_receiver)&&o(e.result_from_sender)).map(e=>e.result_from_sender);return r.length>0?{targets:r,waitable:!0}:null})(a,l);if(!h)return;let m=!0===a.wait_async&&h.waitable;h.targets.forEach(e=>{m?i.delete(e):i.set(e,{index:n,action:a.action,waitable:h.waitable})})})})})}}},39425(e,t,r){let{forEachSubspace:a,forEachEventList:i,getParamValue:n}=r(27899),s=new Set(["Math","Date","Object","Array","Number","String","Boolean","JSON","RegExp","Intl","isNaN","isFinite","parseInt","parseFloat"]);e.exports={code:"expression-global-variable",severity:"error",description:"A PROPERTY_BANK_EXPRESSION variable is named after a JS global and is silently ignored at runtime",check(e,t,r){a(e,(e,t)=>{i(e,t,({path:t,list:a})=>{a.forEach((a,i)=>{if(a?.handler!=="SYSTEM"||"PROPERTY_BANK_EXPRESSION"!==a.action)return;let o=n(a,"VARIABLES");Array.isArray(o)&&o.forEach(a=>{let n=a?.key;"string"==typeof n&&s.has(n)&&r({path:`${t}.${i}`,subspaceId:e,itemId:null,message:`Expression variable "${n}" is named after the JS global \`${n}\` and is silently ignored — the global takes precedence in the expression scope, so the bound value is never used.`,hint:`Rename the variable (e.g. "${n}Value") so the expression reads the bound value.`})})})})})}}},40566(e,t,r){let{forEachSubspace:a,forEachEventList:i,hasParamValue:n}=r(27899),s=[{action:"STORAGE_RETRIEVE",severity:"error",isMissing:e=>!n(e,"STORAGE_RETRIEVE_RESULT"),message:"STORAGE_RETRIEVE requires a STORAGE_RETRIEVE_RESULT parameter — without it the action throws at runtime.",hint:"Add a STORAGE_RETRIEVE_RESULT parameter pointing at a data node."},{action:"TAKE_SCREENSHOT",severity:"warning",isMissing:e=>!n(e,"TAKE_SCREENSHOT_SAVE_PROPERTY"),message:"TAKE_SCREENSHOT without TAKE_SCREENSHOT_SAVE_PROPERTY is silently skipped at runtime.",hint:"Add a TAKE_SCREENSHOT_SAVE_PROPERTY parameter pointing at a data node."},{action:"OPEN_FILE",severity:"warning",isMissing:e=>!n(e,"SAVE_PROPERTY")&&!n(e,"SAVE_DETAIL_PROPERTY"),message:"OPEN_FILE has no SAVE_PROPERTY / SAVE_DETAIL_PROPERTY — the picked file is discarded.",hint:"Add SAVE_PROPERTY (file uri) or SAVE_DETAIL_PROPERTY (file detail) parameters."},{action:"OPEN_URL",severity:"warning",isMissing:e=>!n(e,"URL"),message:"OPEN_URL has no URL parameter — the action does nothing.",hint:"Add a URL parameter."}];e.exports={code:"missing-result-param",severity:"warning",description:"An action is missing the parameter that receives or drives its effect",check(e,t,r){a(e,(e,t)=>{i(e,t,({path:t,list:a})=>{a.forEach((a,i)=>{if(a?.handler!=="SYSTEM")return;let n=s.find(e=>e.action===a.action);n&&n.isMissing(a)&&r({path:`${t}.${i}`,subspaceId:e,itemId:null,severity:n.severity,message:n.message,hint:n.hint})})})})}}},92260(e,t,r){let{forEachSubspace:a,frameIsNumeric:i,getItemId:n,FRAME_KEYS:s}=r(27899),o=["width","height"];e.exports={code:"off-grid-frame",severity:"warning",description:"Frame values should be multiples of the 0.5 grid step",check(e,t,r){let l=t.gridStep;a(e,(e,t)=>{Object.entries(t.canvas_map||{}).forEach(([t,a])=>{(Array.isArray(a?.item_list)?a.item_list:[]).forEach((a,c)=>{let d=a?.frame;if(!i(d))return;let p=s.filter(e=>{let t=d[e];return(!o.includes(e)||!(t<=l))&&Math.abs(t-Math.round(t/l)*l)>.001});0!==p.length&&r({path:`subspace_map.${e}.canvas_map.${t}.item_list.${c}.frame`,subspaceId:e,itemId:n(a),message:`Frame ${p.map(e=>`${e}=${d[e]}`).join(", ")} ${1===p.length?"is":"are"} not aligned to the ${l} grid step.`,hint:`Round frame values to multiples of ${l}.`})})})})}}},96810(e,t,r){let{forEachSubspace:a,frameIsNumeric:i,getItemId:n,itemHasAnimations:s}=r(27899);e.exports={code:"out-of-bounds-frame",severity:"warning",description:"An element is fully outside the subspace layout or has a non-positive size",check(e,t,r){a(e,(a,o)=>{let l=o.layout;"number"!=typeof l?.width||"number"!=typeof l?.height||l.width<=0||l.height<=0||Object.entries(o.canvas_map||{}).forEach(([o,c])=>{(Array.isArray(c?.item_list)?c.item_list:[]).forEach((c,d)=>{let p=c?.frame;if(!i(p)||!0===p.exceed_boundary||p.standby_frame||s(c))return;let h=n(c);if(h&&t.dynamicRefIds.has(h))return;let m=`subspace_map.${a}.canvas_map.${o}.item_list.${d}.frame`;if(p.width<=0||p.height<=0)return void r({path:m,subspaceId:a,itemId:h,message:`Frame has a non-positive size (width=${p.width}, height=${p.height}) — the element renders nothing.`,hint:"Give the element a positive size, or remove it if unused."});let u=a===e.root_subspace_id,f=p.x>=l.width||p.x+p.width<=0,_=p.y>=l.height||p.y+p.height<=0;(f||!u&&_)&&r({path:m,subspaceId:a,itemId:h,message:`Frame (x=${p.x}, y=${p.y}, width=${p.width}, height=${p.height}) is fully outside the ${l.width}\xd7${l.height} layout — nothing is visible.`,hint:"Move the element back into the layout, or set `exceed_boundary` if the placement is intentional."})})})})}}},84223(e,t,r){let{FRAME_KEYS:a,forEachSubspace:i,frameIsNumeric:n,framesAlmostEqual:s,framesIntersect:o,itemHasAnimations:l}=r(27899),c=new Set(["BRICK_TEXT","BRICK_RICH_TEXT"]),d=["linearGradientEnabled","blurEnabled"],p=/^backgroundColor$|^border/,h=(e,t)=>{if(e?.type!=="brick")return null;let r=t[e.brick_id];return c.has(r?.template_key)?r:null},m=e=>a.map(t=>Math.floor(e[t]/.01)),u=e=>e.join(":"),f=(e,t,r,a)=>{if(!n(t?.frame)||!h(t,r))return;let i=u(m(t.frame)),s=(e.get(i)||0)+a;s>0?e.set(i,s):e.delete(i)};e.exports={code:"redundant-rect-overlay",severity:"info",description:"A plain Rect behind a same-frame Text/RichText can be folded into the text brick",check(e,t,r){i(e,(e,a)=>{let i=a.brick_map||{};Object.entries(a.canvas_map||{}).forEach(([a,c])=>{let _,y=Array.isArray(c?.item_list)?c.item_list:[],b=(_=new Map,y.forEach(e=>f(_,e,i,1)),_);y.forEach((c,_)=>{if(f(b,c,i,-1),c?.type!=="brick"||!n(c.frame))return;let E=i[c.brick_id];if(E?.template_key!=="BRICK_RECT"||Object.values(E?.event_map||{}).some(e=>Array.isArray(e)&&e.length>0)||l(c)||t.dynamicRefIds.has(c.brick_id))return;let g={...E.property,...c.property};if(!d.some(e=>g[e])&&((e,t)=>{let[r,a,i,n]=m(t);for(let t=-1;t<=1;t+=1)for(let s=-1;s<=1;s+=1)for(let o=-1;o<=1;o+=1)for(let l=-1;l<=1;l+=1)if(e.has(u([r+t,a+s,i+o,n+l])))return!0;return!1})(b,c.frame))for(let t=_+1;t<y.length;t+=1){let l=y[t];if(!n(l?.frame))continue;let d=h(l,i);if(d&&s(c.frame,l.frame,.01)){let t={...d.property,...l.property};if(Object.keys(t).some(e=>p.test(e)&&void 0!==t[e]))return;r({path:`subspace_map.${e}.canvas_map.${a}.item_list.${_}`,subspaceId:e,itemId:c.brick_id,message:`Rect \`${E.title||c.brick_id}\` has the same frame as the ${d.template_key} above it and only uses base styles.`,hint:"Set backgroundColor / border / radius directly on the text brick and remove the Rect."});return}if(o(c.frame,l.frame))return}})})})}}},31172(e,t,r){let{autoGeneratedItemIdKind:a}=r(99470),{forEachSubspace:i}=r(27899),n="PROPERTY_BANK_",s=()=>({children:Object.create(null),ids:null});e.exports={code:"unused-data-node",severity:"info",description:"A data node is defined but never referenced anywhere in the config",check(e,t,r){let o=JSON.stringify(e),l=[];i(e,(r,i)=>{("module"!==t.configType||r!==e.root_subspace_id)&&Object.entries(i.property_bank_map||{}).forEach(([e,t])=>{!(!t||"object"!=typeof t||t.kind===a||t.enable_remote_update||t.global_remote_update_prop||t.linkedFrom||t.alias||t.preload||i.routing?.[e]?.enabled_routing)&&(Object.values(t?.event_map||{}).some(e=>Array.isArray(e)&&e.length>0)||l.push({subspaceId:r,nodeId:e,node:t}))})});let c=((e,t)=>{let r=[...new Set(t)];if(0===r.length)return new Map;let a=new Map(r.map(e=>[e,0])),i=s();r.forEach(e=>{let t=i;for(let r of e)t.children[r]||(t.children[r]=s()),t=t.children[r];t.ids||(t.ids=[]),t.ids.push(e)});let o=e.indexOf(n);for(;-1!==o;){let t=i;for(let r=o;r<e.length&&(t=t.children[e[r]]);r+=1)t.ids&&t.ids.forEach(e=>{a.set(e,a.get(e)+1)});o=e.indexOf(n,o+1)}return r.forEach(t=>{t.startsWith(n)||a.set(t,e.split(t).length-1)}),a})(o,l.map(({nodeId:e})=>e));l.forEach(({subspaceId:e,nodeId:t,node:a})=>{(c.get(t)||0)>1||r({path:`subspace_map.${e}.property_bank_map.${t}`,subspaceId:e,itemId:t,message:`Data node \`${a.title||t}\` is never referenced in the config.`,hint:"Remove it, or keep it if external tooling depends on it."})})}}},60760(e,t,r){let{forEachSubspace:a,forEachEventList:i}=r(27899),n=new Set(["MESSAGE","ALERT","POPUP_RESET","TAKE_SCREENSHOT","THROW_EXCEPTION","RESTART_FOUNDATION","DYNAMIC_BRICK","DYNAMIC_BRICK_RESET","DYNAMIC_ANIMATION","DYNAMIC_ANIMATION_RESET","DYNAMIC_ANIMATION_STOP","CHANNEL_SUBSCRIBE","CHANNEL_UNSUBSCRIBE","CHANNEL_PUBLISH","DISMISS_KEYBOARD","STORAGE_SET","STORAGE_DELETE","DELAY","USE_SHARE_APPLICATION","AUTH_IN_DEVICE","REFRESH_BINDCODE","STOP_APPLICATION_FILTER"]);e.exports={code:"wait-async-no-op",severity:"info",description:"wait_async is set on an action that ignores it",check(e,t,r){a(e,(e,t)=>{i(e,t,({path:t,list:a})=>{a.forEach((a,i)=>{a?.handler!=="SYSTEM"||!0!==a.wait_async||n.has(a.action)&&r({path:`${t}.${i}`,subspaceId:e,itemId:null,message:"DELAY"===a.action?"DELAY always waits for its timeout — `wait_async: true` is redundant.":`\`wait_async: true\` has no effect on ${a.action}; the action does not block the chain.`,hint:"DELAY"===a.action?"Remove the redundant flag.":"Remove the flag, or restructure if you relied on it for sequencing."})})})})}}},59707(e,t,r){let{forEachSubspace:a,frameIsNumeric:i,frameContains:n,itemHasAnimations:s}=r(27899);e.exports={code:"z-order-cover",severity:"info",description:"A later opaque element fully covers an earlier pressable element",check(e,t,r){a(e,(e,a)=>{let o=a.brick_map||{};Object.entries(a.canvas_map||{}).forEach(([a,l])=>{let c=Array.isArray(l?.item_list)?l.item_list:[],d=[];if(c.forEach((e,t)=>{if(e?.type!=="brick"||!i(e.frame))return;let r=o[e.brick_id];r&&Object.entries(r?.event_map||{}).some(([e,t])=>e.includes("_ON_PRESS")&&Array.isArray(t)&&t.length>0)&&d.push({item:e,index:t,brick:r})}),0===d.length)return;let p=t.dynamicRefIds,h=c.map((e,t)=>((e,t,r,a)=>{let n;if(e?.type!=="brick"||!i(e.frame)||s(e)||a.has(e.brick_id))return null;let o=r[e.brick_id],l={...o?.property,...e.property};return"string"==typeof(n=l.backgroundColor)&&(/^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*1(?:\.0+)?\s*\)$/.test(n)||/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/.test(n)||/^#[0-9a-fA-F]{6}$/.test(n))&&(void 0===l.opacity||1===l.opacity)?{index:t,item:e,brick:o,frame:e.frame}:null})(e,t,o,p)).filter(Boolean),m=(e=>{let t=Array(e.length),r=1/0,a=1/0,i=-1/0,n=-1/0,s=-1/0,o=-1/0;for(let l=e.length-1;l>=0;l-=1){let{frame:c}=e[l];r=Math.min(r,c.x),a=Math.min(a,c.y),i=Math.max(i,c.x+c.width),n=Math.max(n,c.y+c.height),s=Math.max(s,c.width),o=Math.max(o,c.height),t[l]={minX:r,minY:a,maxRight:i,maxBottom:n,maxWidth:s,maxHeight:o}}return t})(h),u=0;d.forEach(({item:t,index:i,brick:o})=>{let l,c;if(!(s(t)||p.has(t.brick_id))){for(;u<h.length&&h[u].index<=i;)u+=1;if(l=m[u],c=t.frame,l&&l.minX<=c.x+.01&&l.minY<=c.y+.01&&l.maxRight>=c.x+c.width-.01&&l.maxBottom>=c.y+c.height-.01&&l.maxWidth>=c.width-.02&&l.maxHeight>=c.height-.02)for(let s=u;s<h.length;s+=1){let l=h[s];if(n(l.frame,t.frame))return void r({path:`subspace_map.${e}.canvas_map.${a}.item_list.${i}`,subspaceId:e,itemId:t.brick_id,message:`Pressable \`${o.title||t.brick_id}\` is fully covered by the opaque \`${l.brick?.title||l.item.brick_id}\` later in the item list — it is invisible and untappable.`,hint:"Reorder the items, shrink the covering element, or remove the hidden one."})}}})})})}}}};
|