{"_id":"@asuramus/quill-better-table","_rev":"1-e230b7d8d01aeca39eaebc6469601d6a","name":"@asuramus/quill-better-table","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@asuramus/quill-better-table","version":"1.0.0","description":"Module for better table in Quill, more useful features are supported.","main":"dist/quill-better-table.js","scripts":{"dev":"webpack-dev-server --config webpack.config.js --mode=development","build":"npm run build:webpack && npm run build:webpack:minimize && npm run build:cleanup","build:webpack:minimize":"webpack --config webpack.config.js --mode=production --env.minimize","build:webpack":"webpack --config webpack.config.js --mode=production","build:cleanup":"rm dist/quill-better-table","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/soccerloway/quill-better-table.git"},"keywords":["quill","quilljs","table","multiline","quilltable"],"author":{"name":"soccerloway"},"license":"MIT","bugs":{"url":"https://github.com/soccerloway/quill-better-table/issues"},"homepage":"https://github.com/soccerloway/quill-better-table#readme","dependencies":{},"devDependencies":{"@babel/core":"^7.4.3","@babel/preset-env":"^7.4.3","babel-loader":"^8.0.5","babel-plugin-istanbul":"^5.1.1","css-loader":"^2.1.1","extend":"^3.0.2","file-loader":"^3.0.1","html-loader":"^0.5.5","html-webpack-plugin":"^3.2.0","mini-css-extract-plugin":"^0.5.0","node-sass":"^4.11.0","quill":"^2.0.0-dev.3","sass-loader":"^7.1.0","style-loader":"^0.23.1","url-loader":"^1.1.2","webpack":"^4.29.6","webpack-cli":"^3.3.0","webpack-dev-server":"^3.2.1"},"gitHead":"dce1df15cdd9f4bd11afa8e92ec81f7365157e38","_id":"@asuramus/quill-better-table@1.0.0","_nodeVersion":"14.16.1","_npmVersion":"7.12.1","dist":{"integrity":"sha512-96e6UOvH1Vjkha/gJEJx3ATKTA4hWOcxIx3pwGAgfLYy3C73mSzByBqcA4Y5FXa+LnsYm/FCLNvP4Ta7uzyUAw==","shasum":"fc5b1c134d22b190b574e7790299b936cd5dc436","tarball":"https://registry.npmjs.org/@asuramus/quill-better-table/-/quill-better-table-1.0.0.tgz","fileCount":33,"unpackedSize":438698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmjOsCRA9TVsSAnZWagAAX5AQAJh+yvWPva0ilBOBr4hV\nr3eD7utOd4OdBaYg99kDz2SiYtf5LMi2pnqq8bRpmMawu0d8qkbNqBAm3f3M\nlhitCDVTzVwaAZzW5BBS/8iFAh0dG2mdJNBAqFuJvlbdz7BfjEViYDCFpe4p\n4xSYDYCimZc7gkbmZxh2F4yLL5SC/Hi17Vs7V8HeY9MlFky5NK0+geS7UWtK\noyl2NnUF1+JTjoCaY9jdO+vdmeGM1G++A3n+6eIf0nbFlwwCFFXMC2K4Dhdf\nPMa6TycPta3PoVdJM0l8/2oW7Yn7hXKu4aWjYF5ENPtkEvhAv/K+gRwdA2bq\nIdkOhuskzi3u2wBO45e7cCLYi/cdPB5p4S1VKeQ7+l1uB7Xj+235nRiVjy/u\naLnsPxSGgHxh+UQK3+8hTpq5/um25cCVNTbSjNkhqoZ0nXDPbxK6NRbkFY4K\n1Le+AxoK0U7gXfMMCFsAtLNkLbRoAHGzByaXGBUet5cI9yYwX4G1zmeK4DwW\nfcuUDp+7Ld3p4zqpmTaaZzXAwyxsaeAIrMKq3kOKteuivXHlf4k5VdDgoo+c\nzjXzw9K4Rd9s2meEMU/Rk96WqPfbnH7J4+lj4lSI0tAy40aDX/A6kZmVDaYm\nFt5b84RUhdzvWxrWSD9lU0wPi0Ql2XJVx/fic20skcob12awGsIienzoJ06J\ntzBM\r\n=V+Yw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1AGTHYtAS/LirXNQWIYgnmK3aZj94dBnEd8WDNufirwIgMPafquufJL9nUMkGqri4FK4SMetB2J3WAAy7d0WE4WA="}]},"_npmUser":{"name":"asuramus","email":"iupin5212@gmail.com"},"directories":{},"maintainers":[{"name":"asuramus","email":"iupin5212@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quill-better-table_1.0.0_1620718507935_0.2893931327039214"},"_hasShrinkwrap":false}},"time":{"created":"2021-05-11T07:35:07.867Z","1.0.0":"2021-05-11T07:35:08.088Z","modified":"2022-04-04T16:00:01.330Z"},"maintainers":[{"name":"asuramus","email":"iupin5212@gmail.com"}],"description":"Module for better table in Quill, more useful features are supported.","homepage":"https://github.com/soccerloway/quill-better-table#readme","keywords":["quill","quilljs","table","multiline","quilltable"],"repository":{"type":"git","url":"git+https://github.com/soccerloway/quill-better-table.git"},"author":{"name":"soccerloway"},"bugs":{"url":"https://github.com/soccerloway/quill-better-table/issues"},"license":"MIT","readme":"# quill-better-table\nA module for better table in Quill, more useful features are supported. There is a list of features below. Thanks [quilljs](https://quilljs.com/) for its awesome extensibility. Hope that quill-better-table could help you.\n\n# Online Demo\n[quill-better-table Codepen Demo](https://codepen.io/soccerloway/pen/WWJowj)\n\n# Updated v1.2.10\n<ul>\n  <li>\n    <p>Replace TableCellLine.tagName from `DIV` to `P`. Using `DIV` to implement TableCellLine led a copy/paste issue: <a href=\"https://github.com/soccerloway/quill-better-table/issues/50\">Pasting plain text also changes to table format</a>. There are many more similar situations. When the user pastes the DIV tag into the editor, the DIV will be treated as a TableCellLine. Using `P` is more appropriate and fixes the mentioned issue. If this update caused any other new issues, tell me as soon as possible please, thanks！ Best wishes.</p>\n  </li>\n</ul>\n\n# Features\nClicking on tables in quill editor will initialize the tools for table, all features are based on it.\n\n<ul>\n  <li>\n    <h3>Multiple lines in table cell</h3>\n    <p>Press Enter to add new lines in the table cell now.</p>\n  </li>\n  <li>\n    <h3>Add table column left/right</h3>\n    <p>Right-click on table to open context menu, you can see the button.</p>\n  </li>\n  <li>\n    <h3>Add table row top/bottom</h3>\n    <p>Right-click on table to open context menu, you can see the button.</p>\n  </li>\n  <li>\n    <h3>Remove selected table columns</h3>\n    <p>Right-click on table to open context menu, you can see the button.</p>\n  </li>\n  <li>\n    <h3>Remove selected table rows</h3>\n    <p>Right-click on table to open context menu, you can see the button.</p>\n  </li>\n  <li>\n    <h3>Selects multiple table cells</h3>\n    <p>Dragging over the table cells could select the tableCells surrounded by the highlight borders.</p>\n  </li>\n  <li>\n    <h3>Merge/Unmerge table cells</h3>\n    <p>Right-click on table to open context menu, you can see the button.</p>\n  </li>\n  <li>\n    <h3>Resize the width of column</h3>\n    <p>Dragging lines between the top tool for columns could resize width of columns.</p>\n  </li>\n  <li>\n    <h3>Delete table</h3>\n    <p>Right-click on table to open context menu, you can see the button.</p>\n  </li>\n</ul>\n\n# Requirements\n[quilljs](https://github.com/quilljs/quill) v2.0.0-dev.3\n\nSince I use webpack externals to bundle, you must expose `Quill` to window object, like load quill.js by script tag globally. Or you may need to fork this repo and build what you need.\n\n# Installation\n```\nnpm install quill-better-table\n```\n\n# Usage\nLoad quill and style dependencies\n```\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/quill/2.0.0-dev.3/quill.min.js\" type=\"text/javascript\"></script>\n```\n```\n<link href=\"https://cdnjs.cloudflare.com/ajax/libs/quill/2.0.0-dev.3/quill.snow.min.css\" rel=\"stylesheet\">\n<link href=\"https://unpkg.com/quill-better-table@1.2.8/dist/quill-better-table.css\" rel=\"stylesheet\">\n```\n\nES6\n```\nimport QuillBetterTable from 'quill-better-table'\n\nQuill.register({\n  'modules/better-table': QuillBetterTable\n}, true)\n\nwindow.onload = () => {\n  const quill = new Quill('#editor-wrapper', {\n    theme: 'snow',\n    modules: {\n      table: false,  // disable table module\n      'better-table': {\n        operationMenu: {\n          items: {\n            unmergeCells: {\n              text: 'Another unmerge cells name'\n            }\n          }\n        }\n      },\n      keyboard: {\n        bindings: QuillBetterTable.keyboardBindings\n      }\n    }\n  })\n\n  document.body.querySelector('#insert-table')\n    .onclick = () => {\n      let tableModule = quill.getModule('better-table')\n      tableModule.insertTable(3, 3)\n    }\n}\n```\n\n# Module methods\nfirst, you can get quill-better-table module by `quill.getModule`\n```\nlet module = quill.getModule('better-table')\n```\n## module.getTable(range = quill.getSelection())\nget an array with TableContainer, TableRow, TableCell, offset through the given range.\n```\nmodule.getTable()  // current selection\nmodule.getTable(range)\n// [TableContainer, TableRow, TableCell, 0]\n```\n\n## module.insertTable(rows: Number, columns: Number)\ninsert table at current position\n```\nmodule.insertTable(3, 3)\n```\n\n# Module Options\nquill-better-table only provide operation options now.\n```\nconst quill = new Quill('#editor', {\n  theme: 'snow',\n  modules: {\n    table: false,  // disable table module\n    'better-table': {\n      operationMenu: {\n        items: {\n          unmergeCells: {\n            text: 'Another unmerge cells name'\n          }\n        },\n        color: {\n          colors: ['#fff', 'red', 'rgb(0, 0, 0)'],  // colors in operationMenu\n          text: 'Background Colors'  // subtitle\n        } \n      }\n    },\n    keyboard: {\n      bindings: QuillBetterTable.keyboardBindings\n    }\n  }\n})\n```\n## operationMenu\nOperationMenu configures the operation list in right-click menu.\n\n## operationMenu.items\noperationMenu show all operations as default. `false` will remove the operation.\n```\n{\n  operationKey: {\n    text: 'foo'\n  },\n\n  operationKey: false\n}\n```\n`operationKey` is the name of operation, there is a list below:\n<ul>\n  <li>insertColumnRight</li>\n  <li>insertColumnLeft</li>\n  <li>insertRowUp</li>\n  <li>insertRowDown</li>\n  <li>mergeCells</li>\n  <li>unmergeCells</li>\n  <li>deleteColumn</li>\n  <li>deleteRow</li>\n  <li>deleteTable</li>\n</ul>\n\nYou may need to modify the menu text, `operationKey.text` will do that.\n\n## operationMenu.color\nBackground colors is optional, the default is hidden. If you need this feature, use this configure.\n```\n{\n  colors: ['#fff', 'red', 'rgb(0, 0, 0)'],  // colors you need in operationMenu, ['white', 'red', 'yellow', 'blue'] as default\n  text: 'Background Colors'  // subtitle, 'Background Colors' as default\n} \n```\n\n# Community\nSend me an email(<a href=\"mailto: lw54760187@hotmail.com\">lw54760187@hotmail.com</a>) or Contribute on [Issues](https://github.com/soccerloway/quill-better-table/issues), I glad to hear your suggestion.\n\n# License\n[MIT License](https://rmm5t.mit-license.org/)\n","readmeFilename":"README.md"}