All Downloads are FREE. Search and download functionalities are using the official Maven repository.

SLING-INF.app-root.components.text.v2.text.json Maven / Gradle / Ivy

{
  "jcr:primaryType": "cq:Component",
  "jcr:title": "wcm.io Text (v2)",
  "componentGroup": ".wcmio-core-wcm",
  "sling:resourceSuperType": "core/wcm/components/text/v2/text",

  "cq:dialog": {
    "jcr:primaryType": "nt:unstructured",
    "content": {
      "items": {
        "tabs": {
          "items": {
            "properties": {
              "items": {
                "columns": {
                  "items": {
                    "column": {
                      "items": {
                        "text": {

                          "htmlRules": {

                            // Ensure valid XHTML markup with  and  tags
                            "docType": {
                              "baseType": "xhtml",
                              "version": "1.0",
                              "typeConfig": {
                                "useSemanticMarkup": true,
                                "semanticMarkupMap": {
                                  "b": "strong",
                                  "i": "em"
                                },
                                "isXhtmlStrict": false
                              }
                            },

                            // Default link dialog configuration
                            "links": {
                              "cssMode": "keep",
                              "protocols": [
                                "http://",
                                "https://",
                                "mailto:"
                              ],
                              "targetConfig": {
                                "mode": "blank"
                              },
                              "ensureInternalLinkExt": false
                            }

                          },

                          "rtePlugins": {
                            /* Disable OOTB link support */
                            "links": {
                              "features": "-"
                            },
                            /* Enable wcm.io RTE link plugin */
                            "wcmio-links": {
                              "features": [
                                "modifylink",
                                "unlink"
                              ]
                            },
                            "edit": {
                              "features": ["cut","copy","paste-plaintext","paste-wordhtml"],
                              "defaultPasteMode": "wordhtml",
                              "htmlPasteRules": {
                                "allowedAttributes": {
                                  "a": [
                                    "href", "name", "title", "alt",
                                    // allow attributes of custom RTE link plugin
                                    "data-link-type", "data-link-content-ref", "data-link-cross-context-content-ref",
                                    "data-link-media-ref", "data-link-external-ref", "data-link-window-target", "data-link-media-download"
                                  ]
                                }
                              }
                            }
                          },

                          "uiSettings": {
                            "cui": {
                              "inline": {
                                "toolbar": [
                                  "format#bold",
                                  "format#italic",
                                  "format#underline",
                                  "#justify",
                                  "#lists",
                                  /* Use wcm.io RTE Link plugin actions */
                                  "wcmio-links#modifylink",
                                  "wcmio-links#unlink",
                                  "#paraformat"
                                ]
                              },
                              "dialogFullScreen": {
                                "toolbar": [
                                  "format#bold",
                                  "format#italic",
                                  "format#underline",
                                  "justify#justifyleft",
                                  "justify#justifycenter",
                                  "justify#justifyright",
                                  "lists#unordered",
                                  "lists#ordered",
                                  "lists#outdent",
                                  "lists#indent",
                                  /* Use wcm.io RTE Link plugin actions */
                                  "wcmio-links#modifylink",
                                  "wcmio-links#unlink",
                                  "table#createoredit",
                                  "#paraformat",
                                  "image#imageProps"
                                ]
                              }
                            }
                          }

                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },

  "cq:design_dialog": {
    "jcr:primaryType": "nt:unstructured",
    "content": {
      "items": {
        "tabs": {
          "items": {
            "plugins": {
              "items": {
                "Formatting": {
                  "items": {
                    "fixedcol": {
                      "items": {
                        "col1": {
                          "items": {
                            /* Hide AEM links plugins, the component uses the wcm.io alternative plugin */
                            "links": {
                              "sling:hideResource": true
                            },
                            "wcmio-links": {
                              "sling:orderBefore": "links",
                              "sling:resourceType": "granite/ui/components/coral/foundation/container",
                              "granite:class": "js-cq-IPEPlugin-group",
                              "items": {
                                "wcmio-links": {
                                  "sling:resourceType": "cq/gui/components/authoring/dialog/inplaceediting/configuration/plugin",
                                  "jcr:title": "Show link insertion options (link, unlink)",
                                  "features": "modifylink,unlink",
                                  "name": "wcmio-links",
                                  "defaultEnabled": true
                                }
                              },
                              "granite:data": {
                                "plugin-root-name": "rtePlugins",
                                "name": "wcmio-links"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },

  "cq:editConfig": {
    "jcr:primaryType": "cq:EditConfig",
    "cq:inherit": true,
    
    "cq:inplaceEditing": {
      "jcr:primaryType": "cq:InplaceEditingConfig",
      "editorType": "text",
      "active": true,
      "configPath": "inplaceEditingConfig",
      "inplaceEditingConfig": {
        "jcr:primaryType": "nt:unstructured",

        "htmlRules": {

          // Ensure valid XHTML markup with  and  tags
          "docType": {
            "baseType": "xhtml",
            "version": "1.0",
            "typeConfig": {
              "useSemanticMarkup": true,
              "semanticMarkupMap": {
                "b": "strong",
                "i": "em"
              },
              "isXhtmlStrict": false
            }
          },

          // Default link dialog configuration
          "links": {
            "cssMode": "keep",
            "protocols": [
              "http://",
              "https://",
              "mailto:"
            ],
            "targetConfig": {
              "mode": "blank"
            },
            "ensureInternalLinkExt": false
          }

        },

        "rtePlugins": {
          "tracklinks": {
            "features": "*"
          },
          "table": {
            "features": "-",
            "hiddenHeaderConfig": {
              "hiddenHeaderClassName": "cq-wcm-foundation-aria-visuallyhidden"
            }
          },
          "paraformat": {
            "formats": {
              "default_p": {
                "description": "Paragraph",
                "tag": "p"
              },
              "default_h1": {
                "description": "Heading 1",
                "tag": "h1"
              },
              "default_h2": {
                "description": "Heading 2",
                "tag": "h2"
              },
              "default_h3": {
                "description": "Heading 3",
                "tag": "h3"
              },
              "default_h4": {
                "description": "Heading 4",
                "tag": "h4"
              },
              "default_h5": {
                "description": "Heading 5",
                "tag": "h5"
              },
              "default_h6": {
                "description": "Heading 6",
                "tag": "h6"
              },
              "default_blockquote": {
                "description": "Quote",
                "tag": "blockquote"
              },
              "default_hr": {
                "description": "Horizontal Rule (visual line break)",
                "tag": "hr"
              },
              "default_pre": {
                "description": "Preformatted",
                "tag": "pre"
              }
            }
          },
          "misctools": {
            "specialCharsConfig": {
              "chars": {
                "default_copyright": {
                  "entity": "©",
                  "name": "copyright"
                },
                "default_euro": {
                  "entity": "€",
                  "name": "euro"
                },
                "default_registered": {
                  "entity": "®",
                  "name": "registered"
                },
                "default_trademark": {
                  "entity": "™",
                  "name": "trademark"
                }
              }
            }
          },
          "edit": {
            "features": ["cut","copy","paste-plaintext","paste-wordhtml"],
            "defaultPasteMode": "wordhtml",
            "htmlPasteRules": {
              "allowedAttributes": {
                "a": [
                  "href", "name", "title", "alt",
                  // allow attributes of custom RTE link plugin
                  "data-link-type", "data-link-content-ref", "data-link-cross-context-content-ref",
                  "data-link-media-ref", "data-link-external-ref", "data-link-window-target", "data-link-media-download"
                ]
              }
            }
          },
          "links": {
            "features": "-"
          },
          "wcmio-links": {
            "features": [
              "modifylink",
              "unlink"
            ]
          },
          "justify": {
            "features": "-"
          },
          "format": {
            "features": "bold,italic"
          }
        },

        // Configure toolbars for IPE and fulltext mode in Touch UI
        "uiSettings": {
          "cui": {
            "inline": {
              "toolbar": [
                "#format",
                "#lists",
                "-",
                "wcmio-links#modifylink",
                "wcmio-links#unlink",
                "-",
                "#paraformat",
                "-",
                "fullscreen#start",
                "-",
                "control#close",
                "control#save"
              ],
              "popovers": {
                "format": {
                  "ref": "format",
                  "items": [
                    "format#bold",
                    "format#italic",
                    "format#underline"
                  ]
                },
                "lists": {
                  "ref": "lists",
                  "icon": "text",
                  "items": [
                    "lists#unordered",
                    "lists#ordered",
                    "lists#outdent",
                    "lists#indent"
                  ]
                },
                "paraformat": {
                  "ref": "paraformat",
                  "items": "paraformat:getFormats:paraformat-pulldown"
                }
              }
            },
            "fullscreen": {
              "toolbar": [
                "format#bold",
                "format#italic",
                "format#underline",
                "-",
                "subsuperscript#subscript",
                "subsuperscript#superscript",
                "-",
                "edit#cut",
                "edit#copy",
                "edit#paste-default",
                "edit#paste-plaintext",
                "edit#paste-wordhtml",
                "-",
                "wcmio-links#modifylink",
                "wcmio-links#unlink",
                "-",
                "findreplace#find",
                "findreplace#replace",
                "-",
                "undo#undo",
                "undo#redo",
                "-",
                "justify#justifyleft",
                "justify#justifycenter",
                "justify#justifyright",
                "justify#justifyjustify",
                "-",
                "lists#unordered",
                "lists#ordered",
                "lists#outdent",
                "lists#indent",
                "-",
                "table#createoredit",
                "image#imageProps",
                "spellcheck#checktext",
                "misctools#specialchars",
                "misctools#sourceedit",
                "-",
                "#paraformat",
                "-",
                "fullscreen#finish"
              ],
              "popovers": {
                "paraformat": {
                  "ref": "paraformat",
                  "items": "paraformat:getFormats:paraformat-pulldown"
                }
              }
            },
            "icons": {
              "justify": {
                "command": "#justify",
                "icon": "coral-Icon coral-Icon--textCenter"
              }
            }
          }
        }

      }
    }

  }

}