Bricks Schema 中文文档:interactions

📄 原始资料 (已截断)  |  展开查看原始 JSON(interactions.json){ “type”: “array”, “description”: “Element interactions: event-driven behavior rules. Each item defines a trigger, action, and target.”, “items”: { “type”: “object”, “description”: “A single interaction rule: when a trigger fires, an action is…

📄 原始资料 (已截断)  |  展开查看原始 JSON(interactions.json)
{
  "type": "array",
  "description": "Element interactions: event-driven behavior rules. Each item defines a trigger, action, and target.",
  "items": {
    "type": "object",
    "description": "A single interaction rule: when a trigger fires, an action is executed on a target element.",
    "properties": {
      "action": {
        "type": "string",
        "description": "Action to perform. show: show element, hide: hide element, click: click element, setAttribute/removeAttribute/toggleAttribute: HTML attribute operations, toggleOffCanvas: toggle offcanvas panel, loadMore: load more query items, startAnimation: CSS animation, scrollTo: scroll to element, javascript: call custom JS function, openAddress/closeAddress: map address, clearForm: clear form, storageAdd/storageRemove/storageCount: browser storage operations.",
        "enum": [
          "show",
          "hide",
          "click",
          "setAttribute",
          "removeAttribute",
          "toggleAttribute",
          "toggleOffCanvas",
          "loadMore",
          "startAnimation",
          "scrollTo",
          "javascript",
          "openAddress",
          "closeAddress",
          "clearForm",
          "storageAdd",
          "storageRemove",
          "storageCount"
        ],
        "descriptionZh": "要执行的操作。show:显示元素,hide:隐藏元素,click:点击元素,setAttribute/removeAttribute/toggleAttribute:HTML 属性操作,toggleOffCanvas:切换离屏面板,loadMore:加载更多等。"
      },
      "actionAttributeKey": {
        "oneOf": [
          {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "null"
            ]
          },
          {
            "type": "object"
          },
          {
            "type": "array"
          }
        ]
      },
      "actionAttributeValue": {
        "oneOf": [
          {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "null"
            ]
          },
          {
            "type": "object"
          },
          {
            "type": "array"
          }
        ]
      },
      "ajaxQueryId": {
        "oneOf": [
          {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "null"
            ]
          },
          {
            "type": "object"
          },
          {
            "type": "array"
          }
        ]
      },
      "animationDelay": {
        "oneOf": [
          {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "null"
            ]
          },
          {
            "type": "object"
          },
          {
            "type": "array"
          }
        ]
      },
      "animationDuration": {
        "oneOf": [
          {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "null"
            ]
          },
          {
            "type": "object"
          },
          {
            "type": "array"
          }
        ]
      },
      "animationId": {
        "oneOf": [
          {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "null"
            ]
          },
          {
            "type": "object"
          },
          {
            "type": "array"
          }
        ]
      },
      "animationType": {
        "oneOf": [
          {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "null"
            ]
          },
          {
            "type": "object"
          },
          {
            "type": "array"
          }
        ]
      },
      "conditionsSep": {
        "oneOf": [
          {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "null"
            ]
          },
          {
            "type": "object"
          },
          {
            "type": "array"
          }
        ]
      },
      "delay": {
        "oneOf": [
          {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "null"
            ]
          },
          {
            "type": "object"
          },
          {
            "type": "array"
          }
        ]
      },
      "disablePreventDefault": {
        "oneOf": [
          {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "null"
            ]
          },
          {
            "type": "object"
          },
          {
            "type": "array"
          }
        ]
      },
      "filterElementId": {
        "oneOf": [
          {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "null"
            ]
          },
          {
            "type": "object"
          },
          {
            "type": "array"
          }
        ]
      },
      "formId": {
        "oneOf": [
          {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "null"
            ]
          },
          {
            "type": "object"
          },
          {
            "type": "array"
          }
        ]
      },
      "id": {
        "type": [
          "string",
          "integer"
        ],
        "description": "Unique identifier for this interaction",
        "descriptionZh": "此交互的唯一标识符。"
      },
      "infoBoxId": {
        "oneOf": [
          {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "null"
            ]
          },
          {
            "type": "object"
          },
          {
            "type": "array"
          }
        ]
      },
      "interactionConditions": {
        "type": "array",
        "description": "Sub-conditions that must be met before the action fires",
        "items": {
          "type": "object",
          "description": "A sub-condition on an interaction that must be met before the action fires. Typically checks browser storage values.",
          "properties": {
            "conditionType": {
              "type": "string",
              "description": "Type of condition check (e.g. \"storage\")",
              "descriptionZh": "条件检查的类型(例如 \"storage\")。"
            },
            "storageCompare": {
              "type": "string",
              "description": "Comparison operator for the storage value",
              "descriptionZh": "存储值的比较运算符。"
            },
            "storageCompareValue": {
              "oneOf": [
                {
                  "type": [
                    "string",
                    "number",
                    "integer",
                    "boolean",
                    "null"
                  ]
                },
                {
                  "type": "object"
                },
                {
                  "type": "array"
                }
              ]
            },
            "storageKey": {
              "oneOf": [
                {
                  "type": [
                    "string",
                    "number",
                    "integer",
                    "boolean",
                    "null"
                  ]
                },
                {
                  "type": "object"
                },
                {
                  "type": "array"
                }
              ]
            }
          },
          "additionalProperties": false,
          "descriptionZh": "交互的子条件,必须在操作触发前满足。通常检查浏览器存储值。"
        },
 

... (内容过长已截断,完整 JSON 见原始文件)

前言

元素交互:基于事件的行为规则。每个项目定义一个触发器、操作和目标。

基本信息

  • 类型array

条目属性

  • action (string):要执行的操作。show:显示元素,hide:隐藏元素,click:点击元素,setAttribute/removeAttribute/toggleAttribute:HTML 属性操作,toggleOffCanvas:切换离屏面板,loadMore:加载更多等。
  • actionAttributeKey
  • actionAttributeValue
  • ajaxQueryId
  • animationDelay
  • animationDuration
  • animationId
  • animationType
  • conditionsSep
  • delay
  • disablePreventDefault
  • filterElementId
  • formId
  • id (["string", "integer"]):此交互的唯一标识符。
  • infoBoxId
  • interactionConditions (array):操作触发前必须满足的子条件。
  • interactionConditionsRelation (string):子条件的组合方式:”and”(全部匹配)或 “or”(任一匹配)。
  • jsFunction
  • jsFunctionArgs (array):传递给自定义 JavaScript 函数的参数(与 action “javascript” 配合使用)。
  • loadMoreQuery
  • loadMoreTargetSelector
  • offCanvasSelector
  • popupContextId
  • popupContextType
  • rootMargin
  • runOnce
  • scrollOffset
  • scrollToDelay
  • scrollToOffset
  • storageType
  • target (string):目标引用:”self” 表示触发元素,元素 ID,或选择器上下文。
  • targetFormSelector
  • targetSelector
  • templateId
  • toggleOffCanvasInfo
  • trigger (string):触发此交互的事件。元素:click、mouseover、focus、blur、mouseenter、mouseleave、enterView、leaveView、animationEnd、ajaxStart、ajaxEnd、formSubmit、formSuccess、formError。浏览器:

补充说明

更多细节可参考 Bricks 官方 Academy 文档