"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var get_quick_actions_exports = {};
__export(get_quick_actions_exports, {
  getQuickActions: () => getQuickActions
});
module.exports = __toCommonJS(get_quick_actions_exports);
var import_wix_ui_icons_common = require("@wix/wix-ui-icons-common");
var import_ricos_types = require("./../../ricos-types/index.js");
var import_tiptap = require("./../../tiptap/index.js");
var import_shape_select_modal = require("../components/shape-select-modal.js");
var import_data_hooks = require("../utils/data-hooks.js");
const getQuickActions = (config, pluginServices) => [
  {
    id: import_ricos_types.Node_Type.SHAPE,
    title: "ShapePlugin_QuickAction_Title",
    icon: import_wix_ui_icons_common.Objects,
    section: import_ricos_types.quickActionsModalSections.Media,
    tags: ["shape", "vector"],
    command: ({ modalService, editor, referenceElement }) => {
      modalService.togglePluginPanel({
        id: import_data_hooks.SHAPE_SELECT_MODAL,
        Component: import_shape_select_modal.ShapeSelectModal,
        componentProps: {
          getShapeUrl: config.getShapeUrl
        },
        isMobile: pluginServices.context.isMobile,
        positioning: {
          referenceElement: referenceElement ?? {
            getBoundingClientRect: () => (0, import_tiptap.posToDOMRect)(
              editor.view,
              editor.view.state.selection.from,
              editor.view.state.selection.to
            )
          },
          placement: "bottom-start"
        }
      });
    }
  }
];
//# sourceMappingURL=get-quick-actions.js.map
