0.5.0 • Published 1 year ago

@sargassum-world/stimulated v0.5.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

stimulated

Reusable modest JS sprinkles & controllers for web apps

Usage

Make a main script which imports and registers any controllers and custom elements you want to use from this package, e.g.:

import {
	CSRFController,
	DefaultScrollableController,
	FormSubmissionController,
	HideableController,
	ImageAutoreloadController,
	LoadFocusController,
	LoadScrollController,
	NavigationLinkController,
	NavigationMenuController,
	ThemeController,
	TurboCableStreamSourceElement,
	TurboCacheController,
	Turbo,
} from '@sargassum-world/stimulated';
import { Application } from 'stimulus';

Turbo.session.drive = true;

customElements.define(
	'turbo-cable-stream-source',
	TurboCableStreamSourceElement,
)

const Stimulus = Application.start();
Stimulus.register('csrf', CSRFController);
Stimulus.register('default-scrollable', DefaultScrollableController);
Stimulus.register('form-submission', FormSubmissionController);
Stimulus.register('hideable', HideableController);
Stimulus.register('image-autoreload', ImageAutoreloadController);
Stimulus.register('load-focus', LoadFocusController);
Stimulus.register('load-scroll', LoadScrollController);
Stimulus.register('navigation-link', NavigationLinkController);
Stimulus.register('navigation-menu', NavigationMenuController);
Stimulus.register('theme', ThemeController);
Stimulus.register('turbo-cache', TurboCacheController);

export {};

Then use your bundler (e.g. rollup) to bundle the main script.

License

Copyright Prakash Lab and the Sargassum project contributors.

SPDX-License-Identifier: Apache-2.0 OR BlueOak-1.0.0

You can use this project either under the Apache 2.0 License or under the Blue Oak Model License 1.0.0; you get to decide. We chose the Apache license because it's OSI-approved, and because it goes well together with the Solderpad Hardware License, which is a license for open hardware used in other related projects but not this project. We prefer the Blue Oak Model License because it's easier to read and understand.

0.4.5

2 years ago

0.4.4

2 years ago

0.5.0

1 year ago

0.4.3

2 years ago

0.4.2

2 years ago

0.3.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.2.10

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago