0.6.29 • Published 2 years ago

@pageboard/elements-semantic-ui v0.6.29

Weekly downloads
3
License
MIT
Repository
github
Last release
2 years ago

pageboard-elements

Elements can be defined in three parts:

  • view, needed by pageboard-read to render blocks
  • schema, needed by pageboard-write to edit attributes, and by pageboard-api to validate blocks
  • edit, defines the specs of the rich text content and optionally a render function for edition.

It's up to pageboard-read and pageboard-write main files to load the files, using either js files or html imports.

everything in a single, requireable js file

Exports everything in a single file, accessible from public/elements/myname.js

(function(exports) {
	exports.myname = {
		view: function(doc, block) {
			// do more than that of course
			return doc.createElement('div');
		},
		edit: function(doc, block) {
			// optional function
		},
		properties: {
			myprop: {
				type: 'string'
			}
		}
		specs: {
			mycontent: 'block+'
		}
	};
})(typeof exports != "undefined" ? exports : window.Pagecut.modules);

multiple js files

Exports edit, view, schema from different files, accessible from public/elements/myname/view.js public/elements/myname/edit.js public/elements/myname/index.js (defines the schema, must be requireable)

It is advised to test before assigning like this

(function(exports) {
	if (!exports.myname) exports.myname = {}; // test here
	exports.myname.properties = {
		myprop: {
			type: 'string'
		}
	};
})(typeof exports != "undefined" ? exports : window.Pagecut.modules);

view and edit files are not supposed to be requireable

(function(exports) {
	if (!exports.myname) exports.myname = {}; // test here
	exports.myname.view = function() {};//...
})(window.Pagecut.modules);

multiple html imports

This layout is also supported: public/elements/myname/view.html public/elements/myname/edit.html public/elements/myname/index.js (defines the schema, must be requireable)

Where view and edit load their assets as script (inline or not), link, or style tags.

0.6.29

2 years ago

0.6.28

5 years ago

0.7.4

5 years ago

0.7.3

5 years ago

0.7.2

5 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.27

5 years ago

0.6.26

5 years ago

0.6.25

5 years ago

0.6.24

5 years ago

0.6.23

5 years ago

0.6.22

5 years ago

0.6.21

5 years ago

0.6.20

5 years ago

0.6.19

5 years ago

0.5.18

5 years ago

0.6.18

5 years ago

0.5.17

5 years ago

0.5.16

5 years ago

0.6.17

5 years ago

0.6.16

5 years ago

0.6.15

5 years ago

0.6.14

5 years ago

0.6.13

5 years ago

0.6.12

5 years ago

0.6.11

5 years ago

0.6.10

5 years ago

0.6.9

5 years ago

0.6.8

5 years ago

0.6.7

5 years ago

0.6.6

5 years ago

0.6.5

5 years ago

0.5.15

5 years ago

0.6.4

5 years ago

0.6.3

5 years ago

0.5.14

5 years ago

0.5.13

5 years ago

0.5.12

5 years ago

0.5.11

5 years ago

0.5.10

5 years ago

0.3.13

6 years ago

0.3.12

6 years ago

0.3.11

6 years ago

0.3.10

6 years ago

0.3.9

6 years ago

0.3.8

6 years ago

0.3.7

6 years ago

0.3.6

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago