Trying to get more of the Tiptap buttons to work. Why does only bold, italics, strike work???

This commit is contained in:
Scott Idem
2024-11-22 17:19:00 -05:00
parent dd8181ba0e
commit 4c09edaceb
4 changed files with 305 additions and 111 deletions

247
package-lock.json generated
View File

@@ -10,10 +10,18 @@
"dependencies": {
"@floating-ui/dom": "^1.6.0",
"@popperjs/core": "^2.11.0",
"@tiptap/core": "^2.8.0",
"@tiptap/extension-color": "^2.8.0",
"@tiptap/pm": "^2.8.0",
"@tiptap/starter-kit": "^2.8.0",
"@tiptap/core": "^2.10.2",
"@tiptap/extension-bullet-list": "^2.10.2",
"@tiptap/extension-color": "^2.10.2",
"@tiptap/extension-document": "^2.10.2",
"@tiptap/extension-highlight": "^2.10.2",
"@tiptap/extension-history": "^2.10.2",
"@tiptap/extension-link": "^2.10.2",
"@tiptap/extension-paragraph": "^2.10.2",
"@tiptap/extension-text": "^2.10.2",
"@tiptap/extension-typography": "^2.10.2",
"@tiptap/pm": "^2.10.2",
"@tiptap/starter-kit": "^2.10.2",
"axios": "^1.7.0",
"dayjs": "^1.11.10",
"dexie": "^4.0.1-beta.14",
@@ -45,7 +53,7 @@
"postcss": "^8.4.41",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"sass-embedded": "^1.79.5",
"sass-embedded": "^1.81.0",
"svelte": "^4.2.0",
"svelte-check": "^4.0.0",
"svelte-highlight": "^7.7.0",
@@ -1399,9 +1407,9 @@
}
},
"node_modules/@tiptap/core": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.10.0.tgz",
"integrity": "sha512-58nAjPxLRFcXepdDqQRC1mhrw6E8Sanqr6bbO4Tz0+FWgDJMZvHG+dOK5wHaDVNSgK2iJDz08ETvQayfOOgDvg==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.10.2.tgz",
"integrity": "sha512-jYLXbYHTi1stLla/74J8NJizDtcJ/uokhG+1gN4DMWHDujaZOrRZhW98o9gN5BYAp4zv//TVX8H+afLZwKGCKQ==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1412,9 +1420,9 @@
}
},
"node_modules/@tiptap/extension-blockquote": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-2.10.0.tgz",
"integrity": "sha512-6Xmfo2lpfIRcbfkLD/NGX4YgQqfgAbu6XaZQZf5oGtHLPTrz4D7Mw20GgNBHzae2XwUCwLMt6zXOkBgU/LnlZg==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-2.10.2.tgz",
"integrity": "sha512-whmep+v0VvBI9Kg5TJ4sKIj7Z+MOjBKAndP0qn1bMoqPNNVRxt92iIud72wfXwfBNcrYiGNlssvsAnPwXfbG9w==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1425,9 +1433,9 @@
}
},
"node_modules/@tiptap/extension-bold": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-2.10.0.tgz",
"integrity": "sha512-1wL8UI1Aii0u2cbDEvwyqsZb2pgBt8HLJdsIax/ELoF2tKCD5821nElqTGLBBg4pUGPa0ru9ZemuL8GdXZp3Qg==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-2.10.2.tgz",
"integrity": "sha512-1KNTXA8HDkhXblkfeRYDdqAu/Xz2fygyaSrvabrfzg5QVYyVYPNJwjrtfTQNyzWOejBVGE3mOyqnjlLUzPmyYA==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1438,9 +1446,9 @@
}
},
"node_modules/@tiptap/extension-bullet-list": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-2.10.0.tgz",
"integrity": "sha512-Cl+DGu6D3SgF/hlKUDNet3gaZFy6cPEonOOkHwzXoybDXXdddFbaTvt9MLkBRUR3ldksXuVRP2/LwZsK5WyxJQ==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-2.10.2.tgz",
"integrity": "sha512-jXtTQXZ3j2cyG2dNyVnGauIbsX8CmDY56MJfDg1p+1UZ3zW2GVbKHfvyuulsjobxEd0DNLxduGqbkDY7x3I+HA==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1451,9 +1459,9 @@
}
},
"node_modules/@tiptap/extension-code": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.10.0.tgz",
"integrity": "sha512-8JznKG1Jmv8gJezZGPoka8oRmfrcAAnMEOeMpKXjwMrIbQ6QynTZpqMGGVL1kfkZlLV84PYm+CGjGgjSsT4iZw==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.10.2.tgz",
"integrity": "sha512-VV14oeOsJ3VqUEjuUl+lzSW/IBLhurmcj9IiN2sq/Voin04dwvtchqP5fNXgmM3+rFM88zNOsbX0e4uSG4R10w==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1464,9 +1472,9 @@
}
},
"node_modules/@tiptap/extension-code-block": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.10.0.tgz",
"integrity": "sha512-QH+LP7L1s1EJlrDFnfgOP0q+Siqt0Zbkx4ICMcUGvEsycl53Ti8P0DRW7fAjRISdTCItuWJYvtmiYY7O3rYb+Q==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.10.2.tgz",
"integrity": "sha512-Y/wkK9Ni4ALGqiGezov62p6cpPcJauBfn2wF1lgJVr6XJ4na5KTCUEbiyBZNbo3aD52vZKgWt8LpLvJ2/5STSw==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1478,9 +1486,9 @@
}
},
"node_modules/@tiptap/extension-color": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-color/-/extension-color-2.10.0.tgz",
"integrity": "sha512-s+RNO+7C+t/Waokh1Oloc4Sn3K9p3o2pjdDGw3sHFyOfZvgfYoz5NIacl20NI8Zvk/Yy2bNWDPe5ypinOOnmag==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-color/-/extension-color-2.10.2.tgz",
"integrity": "sha512-lIUrsk8XBG0h8ft5vU6u0ehPk0pcZK3xjhOLF/qxiGhZNBynX5/Nb7mez05J0/P6GKsD9Hj6UD7wm4ZkGmNT9A==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1492,9 +1500,9 @@
}
},
"node_modules/@tiptap/extension-document": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-document/-/extension-document-2.10.0.tgz",
"integrity": "sha512-vseMW3EKiQAPgdbN48Y8F0nRqWhhrAo9DLacAfP7tu0x3uv44uotNjDBtAgp5QmJmqQVyrEdkLSZaU5vFzduhQ==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-document/-/extension-document-2.10.2.tgz",
"integrity": "sha512-Xodp6rMg6vtKZkyX3I6gVd6OZ9PNz9udhDLdCG6JscVJQPO8viV++39UOH416FCvRT46BdHWNCRu/xjUG1C0rA==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1505,9 +1513,9 @@
}
},
"node_modules/@tiptap/extension-dropcursor": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-2.10.0.tgz",
"integrity": "sha512-tifxp/a3NxTjLAuYBx9XAwVo4MSDoY/mQ8E18QtuXj0vuieCFxd8Bkyre0otubIAAQePXLTVGQoxPrKmMAa+Jg==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-2.10.2.tgz",
"integrity": "sha512-pzkD6Y9r3x4Mb6KqpuPraGNNfxIkQD6dJNtZ9PpU9jVtJDjsGIGdyzCbVJq984UAPBamXiF/5DLwlON7buLd6A==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1519,9 +1527,9 @@
}
},
"node_modules/@tiptap/extension-gapcursor": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-2.10.0.tgz",
"integrity": "sha512-GViEnSnEBE74k7SYdXrQ4aXlKmWkrd9awdj/TgDSORgpZ4Dfyqtn+ENIWWby4NhL+BPM9P5hGCjkQXZsi6JKOw==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-2.10.2.tgz",
"integrity": "sha512-Uj2hIYC5zRPGI9xBYFwtld8JrZ8YZXEqO7sN5VcOwt12cnSmvzga86jUKpj3WOMP/8KamLWW8m8UKHd7Qg1kMA==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1533,9 +1541,9 @@
}
},
"node_modules/@tiptap/extension-hard-break": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-2.10.0.tgz",
"integrity": "sha512-NL/xPYUhhvQyCnOO5Yn+BlBOMLC1ru32nw7ox12TShGmaeKBrnV0DhzBRkyJU0MqCS26oWjieNPxfu0lR3oMSA==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-2.10.2.tgz",
"integrity": "sha512-jEVKEe8I+Ai/qYjVf6Idg2Gpp1Cxn4O4twJ0MnlEdzoaEHgt/OTU5NO0PBZMpoe/4BkOvkETZmqRbrcGsapeYQ==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1546,9 +1554,22 @@
}
},
"node_modules/@tiptap/extension-heading": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-2.10.0.tgz",
"integrity": "sha512-x2Uj5wrAHFaUdlChwLoQVmWtzZCuNyJpBRA19kA4idWL5z+6cIrUWepvwVBxA8ou6ictbzWW15o+blKtW7DlqA==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-2.10.2.tgz",
"integrity": "sha512-OfvE+epZSyB0TbV5/4GdvRPMT1kd0fbgLUEaldWMZOLw/4eOGWZ8yXAtrWkoRMLZfOclgnDfwXvXJLnWXrDdDw==",
"license": "MIT",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"
}
},
"node_modules/@tiptap/extension-highlight": {
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-highlight/-/extension-highlight-2.10.2.tgz",
"integrity": "sha512-yJpqagUS672RPsGRc6JrNuqf3DbMiP+g4Al3cVpU3ff3yEORbCMsgvwkCOE9thSO9B4SOFQP4HzX2x1DLJtjew==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1559,9 +1580,9 @@
}
},
"node_modules/@tiptap/extension-history": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-history/-/extension-history-2.10.0.tgz",
"integrity": "sha512-5aYOmxqaCnw7e7wmWqFZmkpYCxxDjEzFbgVI6WknqNwqeOizR4+YJf3aAt/lTbksLJe47XF+NBX51gOm/ZBCiw==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-history/-/extension-history-2.10.2.tgz",
"integrity": "sha512-Hr5cvYgOAP7vaRD5vbMjirTATFe/zYqnzePhq1c9TQESOi2o0zKxWpZIcHbFFIXCjHLSnpXOZ4yFwHP4k12rgg==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1573,9 +1594,9 @@
}
},
"node_modules/@tiptap/extension-horizontal-rule": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-2.10.0.tgz",
"integrity": "sha512-el1SzI/x/h4HW8UltxJlyMSrRsO55ypKPLQHJC9h7F6kTTR31fJUzQa3AeTFrZvXS0kNHIFRpAMstw+N0L5TYg==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-2.10.2.tgz",
"integrity": "sha512-DqaCUxjXnoVN/yylEjoGIlvKkT1KF8mwFJncJn8oSAukYEaSAK056ETvmyZk+/bzc3aRpfv0Kfn/zmLfHZ3wnA==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1587,9 +1608,9 @@
}
},
"node_modules/@tiptap/extension-italic": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-2.10.0.tgz",
"integrity": "sha512-MqPYbHAEeO8QBvZRIkF4J2OTf/uiUPzUiXGLJ50w1ozfMBIw1txMvfR3g2cpwfvZlcOgYTgy7M0Oq00nQz5eXg==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-2.10.2.tgz",
"integrity": "sha512-6p1YkJEWHuMROzNrK+GFJamujBswpydfR3ZMpIjQTLr4hRhSGrde/B5WODRDS+3JiK1xcN16ZQVPFsRJaHMjfQ==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1599,10 +1620,27 @@
"@tiptap/core": "^2.7.0"
}
},
"node_modules/@tiptap/extension-link": {
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-link/-/extension-link-2.10.2.tgz",
"integrity": "sha512-bgsWdinDPGEiMD0NgphpKaxm4l9+PbPwdLDGDFyEX069VAyuSN4y63Sn32clpwlLcibVu3JxVFClJ+o6wKtmdg==",
"license": "MIT",
"dependencies": {
"linkifyjs": "^4.1.0"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",
"@tiptap/pm": "^2.7.0"
}
},
"node_modules/@tiptap/extension-list-item": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-2.10.0.tgz",
"integrity": "sha512-BxC6NNHd2xcC+mk5hpYWURUdj/mRz6TGFwH5CsyrUXPxApx0+V+EPHaAgdpu8dr+jtTEzjXF62V6e2JmOAPimg==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-2.10.2.tgz",
"integrity": "sha512-NE800m/QCk58MUcfeeCqmDjgOuiwHddaZvCCQIpErZdI2Y0io9RsSYU3HHEFPIfbKsv/ykVTYbwSweTPs1Tmxw==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1613,9 +1651,9 @@
}
},
"node_modules/@tiptap/extension-ordered-list": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-2.10.0.tgz",
"integrity": "sha512-jsK+mvzs7HmxQuQOU3HgIga+v7zUbQlmSP4/danusqUihJ+lc1n0frDCIkVvJrnSB3FChvNgT6ZEA14HOhdJzg==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-2.10.2.tgz",
"integrity": "sha512-1WYknf7/feouoBN7jW9Z6fvN9gzS1WRaOrDVkLZQ2ZLgT+Bs8H8/r1pv23q8Un6lg0mApwqnUxNhLOOrVyDkGQ==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1626,9 +1664,9 @@
}
},
"node_modules/@tiptap/extension-paragraph": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-2.10.0.tgz",
"integrity": "sha512-4LUkVaJYjNdNZ7QOX6TRcA+m7oCtyrLGk49G22wl7XcPBkQPILP1mCUCU4f41bhjfhCgK5PPWP63kMtD+cEACg==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-2.10.2.tgz",
"integrity": "sha512-EZG9W5rsU4uP585cIOrhbAPOUsgqrFbDrj1tZjTbvv0EWK03Un3FGYoGilkcUIxD9uB/XVHP+v2596Ifyi/dvQ==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1639,9 +1677,9 @@
}
},
"node_modules/@tiptap/extension-strike": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-2.10.0.tgz",
"integrity": "sha512-SxApLJMQkxnmPGR3lwaskvLK61yI+Bu9hGZGdwMZqNh6o3LoDOxDaXjHD5joeMYQiqQrBE9zg46506MsXtrU7Q==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-2.10.2.tgz",
"integrity": "sha512-TjrBbO6UbXCt55hV9wRE7h5R/jLTB+z2yn2blz1TfR7wKkX3tJOnb+ptvIHEVFGJOjkZP6Xaj+aAkGVg5dKZYA==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1652,9 +1690,9 @@
}
},
"node_modules/@tiptap/extension-text": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-2.10.0.tgz",
"integrity": "sha512-SSnNncADS1KucdEcJlF6WGCs5+1pAhPrD68vlw34oj3NDT3Zh05KiyXsCV3Nw4wpHOnbWahV+z3uT2SnR+xgoQ==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-2.10.2.tgz",
"integrity": "sha512-7WaJCmHAnf24gZc+Bl64vZgjAFt0CSEc5Jr+f3GII6XeCkZpTCJX85po2MFUhBRZMJheyctyL+UfsRauo/iP0Q==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1665,9 +1703,22 @@
}
},
"node_modules/@tiptap/extension-text-style": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/extension-text-style/-/extension-text-style-2.10.0.tgz",
"integrity": "sha512-VZtH1dp64wg1UcFtUPpRQK+kOm4JHBIv+WXuKX7EnpIEKjHKnyfV94BBVmaqY5UE4n3kbkkmIRB2Cmix/10AMg==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-text-style/-/extension-text-style-2.10.2.tgz",
"integrity": "sha512-dWx5Ean7Rb6rdqO6C/i0qIIABKHFsABZj0mTDr0/ZXsw3V2O4d1cP13evvcc7HMLNAXziRTtWCVU6M06vwM/Pw==",
"license": "MIT",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"
}
},
"node_modules/@tiptap/extension-typography": {
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/extension-typography/-/extension-typography-2.10.2.tgz",
"integrity": "sha512-YqAEWuEoFvlvdGgViHFWheHQjyA0wd0ULw4Xhr97aAinVdIi4My/uIQxF1yG5ThqNHcY9Ho62ieVEeOcXBYTyA==",
"license": "MIT",
"funding": {
"type": "github",
@@ -1678,9 +1729,9 @@
}
},
"node_modules/@tiptap/pm": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/pm/-/pm-2.10.0.tgz",
"integrity": "sha512-ohshlWf4MlW6D3rQkNQnhmiQ2w4pwRoQcJmTPt8UJoIDGkeKmZh494fQp4Aeh80XuGd81SsCv//1HJeyaeHJYQ==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/pm/-/pm-2.10.2.tgz",
"integrity": "sha512-jEgC79uvuEl51XxulutUJPSlhkoY0xQc9R/G4MQltAi+JxJ+KE/pOxgqziWNxBpgUzQqloupjod0kLhLUL4Cig==",
"license": "MIT",
"dependencies": {
"prosemirror-changeset": "^2.2.1",
@@ -1708,32 +1759,32 @@
}
},
"node_modules/@tiptap/starter-kit": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-2.10.0.tgz",
"integrity": "sha512-hMIM9a6HjYZo25EzhZHlKEIR7CFi0grRSOltEyggiyBuQqKFkI7iwCpZVVtviDV1FwV0EPANpIAxPS7aBRgFdg==",
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-2.10.2.tgz",
"integrity": "sha512-YbS9P3zvLhfEWnCPMcvCwK/+3XjMgZX73D1qMu9jVRHtQGI2DMk9u42KWAMLQAMBUESMcIeGxJ9G5IWJO0PsyA==",
"license": "MIT",
"dependencies": {
"@tiptap/core": "^2.10.0",
"@tiptap/extension-blockquote": "^2.10.0",
"@tiptap/extension-bold": "^2.10.0",
"@tiptap/extension-bullet-list": "^2.10.0",
"@tiptap/extension-code": "^2.10.0",
"@tiptap/extension-code-block": "^2.10.0",
"@tiptap/extension-document": "^2.10.0",
"@tiptap/extension-dropcursor": "^2.10.0",
"@tiptap/extension-gapcursor": "^2.10.0",
"@tiptap/extension-hard-break": "^2.10.0",
"@tiptap/extension-heading": "^2.10.0",
"@tiptap/extension-history": "^2.10.0",
"@tiptap/extension-horizontal-rule": "^2.10.0",
"@tiptap/extension-italic": "^2.10.0",
"@tiptap/extension-list-item": "^2.10.0",
"@tiptap/extension-ordered-list": "^2.10.0",
"@tiptap/extension-paragraph": "^2.10.0",
"@tiptap/extension-strike": "^2.10.0",
"@tiptap/extension-text": "^2.10.0",
"@tiptap/extension-text-style": "^2.10.0",
"@tiptap/pm": "^2.10.0"
"@tiptap/core": "^2.10.2",
"@tiptap/extension-blockquote": "^2.10.2",
"@tiptap/extension-bold": "^2.10.2",
"@tiptap/extension-bullet-list": "^2.10.2",
"@tiptap/extension-code": "^2.10.2",
"@tiptap/extension-code-block": "^2.10.2",
"@tiptap/extension-document": "^2.10.2",
"@tiptap/extension-dropcursor": "^2.10.2",
"@tiptap/extension-gapcursor": "^2.10.2",
"@tiptap/extension-hard-break": "^2.10.2",
"@tiptap/extension-heading": "^2.10.2",
"@tiptap/extension-history": "^2.10.2",
"@tiptap/extension-horizontal-rule": "^2.10.2",
"@tiptap/extension-italic": "^2.10.2",
"@tiptap/extension-list-item": "^2.10.2",
"@tiptap/extension-ordered-list": "^2.10.2",
"@tiptap/extension-paragraph": "^2.10.2",
"@tiptap/extension-strike": "^2.10.2",
"@tiptap/extension-text": "^2.10.2",
"@tiptap/extension-text-style": "^2.10.2",
"@tiptap/pm": "^2.10.2"
},
"funding": {
"type": "github",
@@ -3877,6 +3928,12 @@
"uc.micro": "^2.0.0"
}
},
"node_modules/linkifyjs": {
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.1.4.tgz",
"integrity": "sha512-0/NxkHNpiJ0k9VrYCkAn9OtU1eu8xEr1tCCpDtSsVRm/SF0xAak2Gzv3QimSfgUgqLBCDlfhMbu73XvaEHUTPQ==",
"license": "MIT"
},
"node_modules/locate-character": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz",

View File

@@ -57,10 +57,18 @@
"dependencies": {
"@floating-ui/dom": "^1.6.0",
"@popperjs/core": "^2.11.0",
"@tiptap/core": "^2.8.0",
"@tiptap/extension-color": "^2.8.0",
"@tiptap/pm": "^2.8.0",
"@tiptap/starter-kit": "^2.8.0",
"@tiptap/core": "^2.10.2",
"@tiptap/extension-bullet-list": "^2.10.2",
"@tiptap/extension-color": "^2.10.2",
"@tiptap/extension-document": "^2.10.2",
"@tiptap/extension-highlight": "^2.10.2",
"@tiptap/extension-history": "^2.10.2",
"@tiptap/extension-link": "^2.10.2",
"@tiptap/extension-paragraph": "^2.10.2",
"@tiptap/extension-text": "^2.10.2",
"@tiptap/extension-typography": "^2.10.2",
"@tiptap/pm": "^2.10.2",
"@tiptap/starter-kit": "^2.10.2",
"axios": "^1.7.0",
"dayjs": "^1.11.10",
"dexie": "^4.0.1-beta.14",

View File

@@ -1,18 +1,31 @@
<script lang="ts">
import { onMount, onDestroy } from 'svelte';
import { fade } from 'svelte/transition'
import { Color } from '@tiptap/extension-color'
import ListItem from '@tiptap/extension-list-item'
import TextStyle from '@tiptap/extension-text-style'
import StarterKit from "@tiptap/starter-kit";
import { Editor } from "@tiptap/core";
// import Highlight from '@tiptap/extension-highlight';
import { cubicOut } from 'svelte/easing';
// import Highlight from '@tiptap/extension-highlight' ????
// import Typography from '@tiptap/extension-typography' ????
// Import Tiptap related modules
import { Editor } from "@tiptap/core";
import StarterKit from "@tiptap/starter-kit";
import Bold from '@tiptap/extension-bold';
import BulletList from '@tiptap/extension-bullet-list';
import CodeBlock from '@tiptap/extension-code-block';
import Code from '@tiptap/extension-code';
import Color from '@tiptap/extension-color';
import Document from '@tiptap/extension-document';
import Heading from '@tiptap/extension-heading';
import Highlight from '@tiptap/extension-highlight';
import History from '@tiptap/extension-history';
import Italic from '@tiptap/extension-italic';
import Link from '@tiptap/extension-link';
import ListItem from '@tiptap/extension-list-item';
import OrderedList from '@tiptap/extension-ordered-list';
import Paragraph from '@tiptap/extension-paragraph';
import Strike from '@tiptap/extension-strike';
import Text from '@tiptap/extension-text';
import TextStyle from '@tiptap/extension-text-style';
import Typography from '@tiptap/extension-typography';
import "./element_tiptap_editor.scss";
import { cubicOut } from 'svelte/easing';
// https://tiptap.dev/docs/examples/basics/default-text-editor
// https://tiptap.dev/docs/examples/basics/formatting
@@ -67,14 +80,27 @@ let show_button_kv_defaults: any = {
italic: true,
strike: true,
code: true,
paragraph: true,
heading__h1: true,
heading__h2: true,
heading__h3: true,
unsetAllMarks: true,
heading__h4: false,
heading__h5: false,
heading__h6: false,
bulletList: true,
orderedList: true,
codeBlock: false,
blockquote: false,
horizontalRule: false,
hardBreak: true,
link: true,
unsetLink: true,
unsetAllMarks: true,
undo: true,
redo: true,
};
@@ -93,9 +119,86 @@ onMount(() => {
editor = new Editor({
element: element,
extensions: [
// StarterKit,
Bold, // part of StarterKit
Code, // part of StarterKit
CodeBlock, // part of StarterKit
Italic, // part of StarterKit
Strike, // part of StarterKit
BulletList, // part of StarterKit
Color.configure({ types: [TextStyle.name, ListItem.name] }),
TextStyle.configure({ types: [ListItem.name] }),
StarterKit,
Heading.configure({ levels: [1, 2, 3, 4, 5, 6] }),
Highlight,
History.configure({
depth: 100,
newGroupDelay: 500
}),
Link.configure({
openOnClick: false,
autolink: true,
defaultProtocol: 'https',
protocols: ['http', 'https'],
isAllowedUri: (url, ctx) => {
try {
// construct URL
const parsedUrl = url.includes(':') ? new URL(url) : new URL(`${ctx.defaultProtocol}://${url}`)
// use default validation
if (!ctx.defaultValidate(parsedUrl.href)) {
return false
}
// disallowed protocols
const disallowedProtocols = ['ftp', 'file', 'mailto']
const protocol = parsedUrl.protocol.replace(':', '')
if (disallowedProtocols.includes(protocol)) {
return false
}
// only allow protocols specified in ctx.protocols
const allowedProtocols = ctx.protocols.map(p => (typeof p === 'string' ? p : p.scheme))
if (!allowedProtocols.includes(protocol)) {
return false
}
// disallowed domains
const disallowedDomains = ['example-phishing.com', 'malicious-site.net']
const domain = parsedUrl.hostname
if (disallowedDomains.includes(domain)) {
return false
}
// all checks have passed
return true
} catch (error) {
return false
}
},
shouldAutoLink: url => {
try {
// construct URL
const parsedUrl = url.includes(':') ? new URL(url) : new URL(`https://${url}`)
// only auto-link if the domain is not in the disallowed list
const disallowedDomains = ['example-no-autolink.com', 'another-no-autolink.com']
const domain = parsedUrl.hostname
return !disallowedDomains.includes(domain)
} catch (error) {
return false
}
},
}),
ListItem,
Document,
OrderedList, // part of StarterKit
Paragraph,
Text,
Typography,
],
content: html_text,
onTransaction: () => {
@@ -399,6 +502,32 @@ let mouse_leave_wait: number = 2000;
</span>
<span>
<!-- Links: -->
<button
type="button"
on:click={() => editor.chain().focus().toggleLink({ href: 'https://example.com' }).run()}
class="btn btn-sm variant-glass-secondary hover:variant-filled-secondary rounded-md"
class:variant-ghost-success={editor.isActive('link') ? 'is-active' : ''}
class:hidden={!show_button_kv.link}
title="Link"
>
<span class="fas fa-link mx-1"></span>
<!-- Link -->
</button>
<button
type="button"
on:click={() => editor.chain().focus().unsetLink().run()}
class="btn btn-sm variant-glass-secondary hover:variant-filled-warning rounded-md"
class:hidden={!show_button_kv.unsetLink}
title="Unset link"
>
<span class="fas fa-unlink mx-1"></span>
<!-- Unset link -->
</button>
</span>
<span
class="justify-self-end"
>

View File

@@ -330,7 +330,7 @@ function send_poster_notification_email() {
<Tiptap_editor
default_minimal={true}
bind:html_text={$idaa_slct.post_comment_obj.content}
show_button_kv={{'heading__h1': false, 'heading__h2': false, 'heading__h3': false}}
show_button_kv={{'heading__h1': true, 'heading__h2': false, 'heading__h3': false}}
bind:new_html={$idaa_slct.post_comment_obj.content_new_html}
placeholder="Your post content here..."
/>