",
+ value: value
+ };
+ }
+ if (typeof value !== "object" || value === null) {
+ return false;
+ }
+ var entries = getEntries != null ? getEntries(value) : Object.entries(value);
+ var hasIgnoredPaths = ignoredPaths.length > 0;
+ for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
+ var _c = entries_1[_i], key = _c[0], nestedValue = _c[1];
+ var nestedPath = path ? path + "." + key : key;
+ if (hasIgnoredPaths && ignoredPaths.indexOf(nestedPath) >= 0) {
+ continue;
+ }
+ if (!isSerializable(nestedValue)) {
+ return {
+ keyPath: nestedPath,
+ value: nestedValue
+ };
+ }
+ if (typeof nestedValue === "object") {
+ foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths);
+ if (foundNestedSerializable) {
+ return foundNestedSerializable;
+ }
+ }
+ }
+ return false;
+}
+function createSerializableStateInvariantMiddleware(options) {
+ if (options === void 0) { options = {}; }
+ var _c = options.isSerializable, isSerializable = _c === void 0 ? isPlain : _c, getEntries = options.getEntries, _d = options.ignoredActions, ignoredActions = _d === void 0 ? [] : _d, _e = options.ignoredActionPaths, ignoredActionPaths = _e === void 0 ? ["meta.arg", "meta.baseQueryMeta"] : _e, _f = options.ignoredPaths, ignoredPaths = _f === void 0 ? [] : _f, _g = options.warnAfter, warnAfter = _g === void 0 ? 32 : _g, _h = options.ignoreState, ignoreState = _h === void 0 ? false : _h, _j = options.ignoreActions, ignoreActions = _j === void 0 ? false : _j;
+ return function (storeAPI) { return function (next) { return function (action) {
+ var result = next(action);
+ var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware");
+ if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {
+ measureUtils.measureTime(function () {
+ var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths);
+ if (foundActionNonSerializableValue) {
+ var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value;
+ console.error("A non-serializable value was detected in an action, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the logic that dispatched this action: ", action, "\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)", "\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)");
+ }
+ });
+ }
+ if (!ignoreState) {
+ measureUtils.measureTime(function () {
+ var state = storeAPI.getState();
+ var foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths);
+ if (foundStateNonSerializableValue) {
+ var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value;
+ console.error("A non-serializable value was detected in the state, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the reducer(s) handling this action type: " + action.type + ".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)");
+ }
+ });
+ measureUtils.warnIfExceeded();
+ }
+ return result;
+ }; }; };
+}
+// src/getDefaultMiddleware.ts
+function isBoolean(x) {
+ return typeof x === "boolean";
+}
+function curryGetDefaultMiddleware() {
+ return function curriedGetDefaultMiddleware(options) {
+ return getDefaultMiddleware(options);
+ };
+}
+function getDefaultMiddleware(options) {
+ if (options === void 0) { options = {}; }
+ var _c = options.thunk, thunk = _c === void 0 ? true : _c, _d = options.immutableCheck, immutableCheck = _d === void 0 ? true : _d, _e = options.serializableCheck, serializableCheck = _e === void 0 ? true : _e;
+ var middlewareArray = new MiddlewareArray();
+ if (thunk) {
+ if (isBoolean(thunk)) {
+ middlewareArray.push(thunkMiddleware);
+ }
+ else {
+ middlewareArray.push(thunkMiddleware.withExtraArgument(thunk.extraArgument));
+ }
+ }
+ {
+ if (immutableCheck) {
+ var immutableOptions = {};
+ if (!isBoolean(immutableCheck)) {
+ immutableOptions = immutableCheck;
+ }
+ middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));
+ }
+ if (serializableCheck) {
+ var serializableOptions = {};
+ if (!isBoolean(serializableCheck)) {
+ serializableOptions = serializableCheck;
+ }
+ middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));
+ }
+ }
+ return middlewareArray;
+}
+// src/configureStore.ts
+var IS_PRODUCTION = "undefined" === "production";
+function configureStore(options) {
+ var curriedGetDefaultMiddleware = curryGetDefaultMiddleware();
+ var _c = options || {}, _d = _c.reducer, reducer = _d === void 0 ? void 0 : _d, _e = _c.middleware, middleware = _e === void 0 ? curriedGetDefaultMiddleware() : _e, _f = _c.devTools, devTools = _f === void 0 ? true : _f, _g = _c.preloadedState, preloadedState = _g === void 0 ? void 0 : _g, _h = _c.enhancers, enhancers = _h === void 0 ? void 0 : _h;
+ var rootReducer;
+ if (typeof reducer === "function") {
+ rootReducer = reducer;
+ }
+ else if (isPlainObject(reducer)) {
+ rootReducer = combineReducers(reducer);
+ }
+ else {
+ throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');
+ }
+ var finalMiddleware = middleware;
+ if (typeof finalMiddleware === "function") {
+ finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware);
+ if (!Array.isArray(finalMiddleware)) {
+ throw new Error("when using a middleware builder function, an array of middleware must be returned");
+ }
+ }
+ if (finalMiddleware.some(function (item) { return typeof item !== "function"; })) {
+ throw new Error("each middleware provided to configureStore must be a function");
+ }
+ var middlewareEnhancer = applyMiddleware.apply(void 0, finalMiddleware);
+ var finalCompose = compose;
+ if (devTools) {
+ finalCompose = composeWithDevTools(__spreadValues({
+ trace: !IS_PRODUCTION
+ }, typeof devTools === "object" && devTools));
+ }
+ var storeEnhancers = [middlewareEnhancer];
+ if (Array.isArray(enhancers)) {
+ storeEnhancers = __spreadArray([middlewareEnhancer], enhancers);
+ }
+ else if (typeof enhancers === "function") {
+ storeEnhancers = enhancers(storeEnhancers);
+ }
+ var composedEnhancer = finalCompose.apply(void 0, storeEnhancers);
+ return createStore(rootReducer, preloadedState, composedEnhancer);
+}
+// src/createAction.ts
+function createAction(type, prepareAction) {
+ function actionCreator() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ if (prepareAction) {
+ var prepared = prepareAction.apply(void 0, args);
+ if (!prepared) {
+ throw new Error("prepareAction did not return an object");
+ }
+ return __spreadValues(__spreadValues({
+ type: type,
+ payload: prepared.payload
+ }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
+ }
+ return { type: type, payload: args[0] };
+ }
+ actionCreator.toString = function () { return "" + type; };
+ actionCreator.type = type;
+ actionCreator.match = function (action) { return action.type === type; };
+ return actionCreator;
+}
+// src/mapBuilders.ts
+function executeReducerBuilderCallback(builderCallback) {
+ var actionsMap = {};
+ var actionMatchers = [];
+ var defaultCaseReducer;
+ var builder = {
+ addCase: function (typeOrActionCreator, reducer) {
+ {
+ if (actionMatchers.length > 0) {
+ throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");
+ }
+ if (defaultCaseReducer) {
+ throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`");
+ }
+ }
+ var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
+ if (type in actionsMap) {
+ throw new Error("addCase cannot be called with two reducers for the same action type");
+ }
+ actionsMap[type] = reducer;
+ return builder;
+ },
+ addMatcher: function (matcher, reducer) {
+ {
+ if (defaultCaseReducer) {
+ throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
+ }
+ }
+ actionMatchers.push({ matcher: matcher, reducer: reducer });
+ return builder;
+ },
+ addDefaultCase: function (reducer) {
+ {
+ if (defaultCaseReducer) {
+ throw new Error("`builder.addDefaultCase` can only be called once");
+ }
+ }
+ defaultCaseReducer = reducer;
+ return builder;
+ }
+ };
+ builderCallback(builder);
+ return [actionsMap, actionMatchers, defaultCaseReducer];
+}
+// src/createReducer.ts
+function isStateFunction(x) {
+ return typeof x === "function";
+}
+function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {
+ if (actionMatchers === void 0) { actionMatchers = []; }
+ var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];
+ var getInitialState;
+ if (isStateFunction(initialState)) {
+ getInitialState = function () { return freezeDraftable(initialState()); };
+ }
+ else {
+ var frozenInitialState_1 = freezeDraftable(initialState);
+ getInitialState = function () { return frozenInitialState_1; };
+ }
+ function reducer(state, action) {
+ if (state === void 0) { state = getInitialState(); }
+ var caseReducers = __spreadArray([
+ actionsMap[action.type]
+ ], finalActionMatchers.filter(function (_c) {
+ var matcher = _c.matcher;
+ return matcher(action);
+ }).map(function (_c) {
+ var reducer2 = _c.reducer;
+ return reducer2;
+ }));
+ if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) {
+ caseReducers = [finalDefaultCaseReducer];
+ }
+ return caseReducers.reduce(function (previousState, caseReducer) {
+ if (caseReducer) {
+ if (r(previousState)) {
+ var draft = previousState;
+ var result = caseReducer(draft, action);
+ if (typeof result === "undefined") {
+ return previousState;
+ }
+ return result;
+ }
+ else if (!t$1(previousState)) {
+ var result = caseReducer(previousState, action);
+ if (typeof result === "undefined") {
+ if (previousState === null) {
+ return previousState;
+ }
+ throw Error("A case reducer on a non-draftable value must not return undefined");
+ }
+ return result;
+ }
+ else {
+ return fn(previousState, function (draft) {
+ return caseReducer(draft, action);
+ });
+ }
+ }
+ return previousState;
+ }, state);
+ }
+ reducer.getInitialState = getInitialState;
+ return reducer;
+}
+// src/createSlice.ts
+function getType2(slice, actionKey) {
+ return slice + "/" + actionKey;
+}
+function createSlice(options) {
+ var name = options.name;
+ if (!name) {
+ throw new Error("`name` is a required option for createSlice");
+ }
+ if (typeof process !== "undefined" && "undefined" === "development") {
+ if (options.initialState === void 0) {
+ console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
+ }
+ }
+ var initialState = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState);
+ var reducers = options.reducers || {};
+ var reducerNames = Object.keys(reducers);
+ var sliceCaseReducersByName = {};
+ var sliceCaseReducersByType = {};
+ var actionCreators = {};
+ reducerNames.forEach(function (reducerName) {
+ var maybeReducerWithPrepare = reducers[reducerName];
+ var type = getType2(name, reducerName);
+ var caseReducer;
+ var prepareCallback;
+ if ("reducer" in maybeReducerWithPrepare) {
+ caseReducer = maybeReducerWithPrepare.reducer;
+ prepareCallback = maybeReducerWithPrepare.prepare;
+ }
+ else {
+ caseReducer = maybeReducerWithPrepare;
+ }
+ sliceCaseReducersByName[reducerName] = caseReducer;
+ sliceCaseReducersByType[type] = caseReducer;
+ actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);
+ });
+ function buildReducer() {
+ var _c = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers], _d = _c[0], extraReducers = _d === void 0 ? {} : _d, _e = _c[1], actionMatchers = _e === void 0 ? [] : _e, _f = _c[2], defaultCaseReducer = _f === void 0 ? void 0 : _f;
+ var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType);
+ return createReducer(initialState, finalCaseReducers, actionMatchers, defaultCaseReducer);
+ }
+ var _reducer;
+ return {
+ name: name,
+ reducer: function (state, action) {
+ if (!_reducer)
+ _reducer = buildReducer();
+ return _reducer(state, action);
+ },
+ actions: actionCreators,
+ caseReducers: sliceCaseReducersByName,
+ getInitialState: function () {
+ if (!_reducer)
+ _reducer = buildReducer();
+ return _reducer.getInitialState();
+ }
+ };
+}
+var alm = "listenerMiddleware";
+createAction(alm + "/add");
+createAction(alm + "/removeAll");
+createAction(alm + "/remove");
+// src/index.ts
+N();
+
+const { actions: todoStoreActions, reducer: todoStoreReducer } = createSlice({
+ name: 'todoStore',
+ initialState: {
+ todos: {},
+ completed: [],
+ editingTodo: 0
+ },
+ reducers: {
+ setTodo: (state, { payload }) => {
+ state.todos[payload.id] = payload;
+ },
+ removeTodos: (state, { payload }) => {
+ payload.forEach((id) => (
+ delete state.todos[id]
+ ));
+ },
+ appendCompleted: (state, { payload }) => {
+ console.log('appendCompleted', payload);
+ state.completed.push(payload);
+ },
+ removeCompleted: (state, { payload }) => {
+ state.completed.splice(
+ state.completed.findIndex((id) => id === payload),
+ 1
+ );
+ },
+ clearCompleted: (state) => {
+ state.completed = [];
+ },
+ setEdit: (state, { payload }) => {
+ state.editingTodo = payload;
+ },
+ leaveEdit: (state) => {
+ state.editingTodo = 0;
+ }
+ }
+});
+
+const store = configureStore({
+ reducer: todoStoreReducer
+});
+
+const {
+ setTodo, removeTodos, appendCompleted, removeCompleted,
+ clearCompleted, setEdit, leaveEdit
+} = todoStoreActions;
+
+const deleteTodo = (id) => {
+ store.dispatch(removeCompleted(id));
+ store.dispatch(removeTodos([id]));
+};
+
+const deleteCompleted = () => {
+ const state = store.getState();
+
+ store.dispatch(removeTodos(state.completed));
+ store.dispatch(clearCompleted());
+};
+
+const toggleTodos = (items) => {
+ const state = store.getState();
+ items.forEach((id) => {
+ let todo = state.todos[id];
+ let todoState = !todo.completed;
+
+ todoState
+ ? store.dispatch(appendCompleted(id))
+ : store.dispatch(removeCompleted(id));
+
+ store.dispatch(setTodo({ ...todo, completed: todoState }));
+ });
+};
+
+const markAll = () => {
+ let state = store.getState();
+ let shouldMarkAll = state.completed.length === Object.keys(state.todos).length;
+
+ if (shouldMarkAll) {
+ const items = Array.from(Object.keys(state.todos));
+ return toggleTodos(items)
+ }
+
+ const filterItems = (acc, item) =>
+ item.completed ? acc : acc.concat(item.id);
+
+ const items = Array.from(Object.values(state.todos))
+ .reduce(filterItems, []);
+
+ store.dispatch(toggleTodos(items));
+};
+
+const addTodoByText = (text) => {
+ store.dispatch(setTodo({
+ text,
+ completed: false,
+ id: Date.now()
+ }));
+};
+
+const getTodos = (filter) => {
+ let { todos } = store.getState();
+ console.log(11, store.getState());
+ return Object.entries(todos).reduce((prev, [id, todo]) => {
+ if (
+ !filter ||
+ filter === 'all' ||
+ (filter === 'active' && !todo.completed) ||
+ (filter === 'completed' && todo.completed)
+ ) {
+ prev[id] = todo;
+ return prev
+ }
+
+ return prev
+ }, {})
+};
+
+const baseStyleSheet = [].slice
+ .call(document.styleSheets)
+ .find((file) => file.href && file.href.endsWith('todomvc-common/base.css'));
+const baseCSSRules = [].slice
+ .call(baseStyleSheet.cssRules)
+ .map(({ cssText }) => cssText);
+
+const appStyleSheet = [].slice
+ .call(document.styleSheets)
+ .find((file) => file.href && file.href.endsWith('todomvc-app-css/index.css'));
+const appCSSRules = [].slice
+ .call(appStyleSheet.cssRules)
+ .map(({ cssText }) => cssText);
+
+class TodoForm extends s$1 {
+ static styles = [
+ r$3`:host(:focus) { box-shadow: none!important }`,
+ ...baseCSSRules.map((r) => o$5(r)),
+ ...appCSSRules.map((r) => o$5(r))
+ ]
+
+ render () {
+ return $`
+
+ `;
+ }
+
+ handleSubmit (event) {
+ event.preventDefault();
+ if (event.target[0].value.length <= 0) {
+ return
+ }
+
+ addTodoByText(event.target[0].value);
+ event.target[0].value = '';
+ }
+}
+customElements.define('todo-form', TodoForm);
+
+/**
+ * @license
+ * Copyright 2017 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
+
+/**
+ * @license
+ * Copyright 2018 Google LLC
+ * SPDX-License-Identifier: BSD-3-Clause
+ */const o=e(class extends i{constructor(t$1){var i;if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||(null===(i=t$1.strings)||void 0===i?void 0:i.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((i=>t[i])).join(" ")+" "}update(i,[s]){var r,o;if(void 0===this.nt){this.nt=new Set,void 0!==i.strings&&(this.st=new Set(i.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in s)s[t]&&!(null===(r=this.st)||void 0===r?void 0:r.has(t))&&this.nt.add(t);return this.render(s)}const e=i.element.classList;this.nt.forEach((t=>{t in s||(e.remove(t),this.nt.delete(t));}));for(const t in s){const i=!!s[t];i===this.nt.has(t)||(null===(o=this.st)||void 0===o?void 0:o.has(t))||(i?(e.add(t),this.nt.add(t)):(e.remove(t),this.nt.delete(t)));}return b$1}});
+
+const ESCAPE_KEY = 27;
+
+class TodoItem extends connect(store)(s$1) {
+ static properties = {
+ todo: { type: Object }
+ }
+
+ static styles = [
+ r$3`
+ :host(:focus) { box-shadow: none!important; }
+ .todo-list li:last-child {
+ border-bottom: 1px solid #ededed!important;
+ }
+ `,
+ ...baseCSSRules.map((r) => o$5(r)),
+ ...appCSSRules.map((r) => o$5(r))
+ ]
+
+ get isEditing () {
+ const state = store.getState();
+ return this.todo.id === state.editingTodo
+ }
+
+ stateChanged() {
+ this.requestUpdate();
+ }
+
+ beginEdit(event) {
+ setEdit(this.todo.id);
+ event.target.closest('li').lastElementChild[0].select();
+ }
+
+ finishEdit(event) {
+ event.preventDefault();
+
+ const text = event.target[0].value;
+ setTodo({ ...this.todo, text });
+ leaveEdit();
+ }
+
+ abortEdit(event) {
+ event.target.value = this.todo.text;
+ leaveEdit();
+ }
+
+ captureEscape(event) {
+ if (event.which === ESCAPE_KEY) {
+ abortEdit(event);
+ }
+ }
+
+ render() {
+ const itemClassList = {
+ todo: true,
+ completed: this.todo.completed,
+ editing: this.isEditing
+ };
+ return $`
+
+ `
+ }
+}
+customElements.define('todo-item', TodoItem);
+
+class TodoList extends s$1 {
+ static properties = {
+ todos: { type: Object }
+ }
+
+ static styles = [
+ r$3`:host(:focus) { box-shadow: none!important }`,
+ ...baseCSSRules.map((r) => o$5(r)),
+ ...appCSSRules.map((r) => o$5(r))
+ ]
+
+ render () {
+ return $`
+ ${n$1(Object.keys(this.todos).length > 0, () => $`
+
+ `
+ )}
+
+ ${Object.values(this.todos).map((todo) => $`
+
+ `)}
+
+ `
+ }
+}
+customElements.define('todo-list', TodoList);
+
+function filterLink({ text, filter, selectedFilter }) {
+ return $`${text}`;
+}
+
+class Footer extends s$1 {
+ static properties = {
+ itemsLeft: { type: Number },
+ totalItems: { type: Number },
+ selectedFilter: { type: String }
+ }
+
+ static styles = [
+ r$3`:host(:focus) { box-shadow: none!important }`,
+ ...baseCSSRules.map((r) => o$5(r)),
+ ...appCSSRules.map((r) => o$5(r))
+ ]
+
+ render () {
+ return $`
+ `
+ }
+}
+customElements.define('todo-footer', Footer);
+
+class TodoApp extends connect(store)(s$1) {
+ static styles = [
+ r$3`:host(:focus) { box-shadow: none!important }`,
+ ...baseCSSRules.map((r) => o$5(r)),
+ ...appCSSRules.map((r) => o$5(r))
+ ]
+
+ static getFilter () {
+ return location.hash.includes('#/')
+ ? location.hash.replace('#/', '')
+ : 'all'
+ }
+
+ constructor (...args) {
+ super(...args);
+
+ this.filter = TodoApp.getFilter();
+ window.addEventListener('hashchange', () => {
+ this.filter = TodoApp.getFilter();
+ this.requestUpdate();
+ });
+ }
+
+ stateChanged() {
+ this.requestUpdate();
+ }
+
+ get todos () {
+ return getTodos(this.filter)
+ }
+
+ get itemsLeft () {
+ const state = store.getState();
+ console.log('!!', state.todos);
+ return this.totalItems - state.completed.length
+ }
+
+ get totalItems () {
+ const state = store.getState();
+ return Object.keys(state.todos).length
+ }
+
+ render () {
+ return $`
+
+
+
+ ${n$1(this.totalItems > 0, () => $`
+
+
+ `)}
+
+ `
+ }
+}
+customElements.define('todo-app', TodoApp);
+//# sourceMappingURL=index.js.map
diff --git a/examples/lit/package.json b/examples/lit/package.json
new file mode 100644
index 0000000000..3c0b12aaa6
--- /dev/null
+++ b/examples/lit/package.json
@@ -0,0 +1,21 @@
+{
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "clean": "rimraf out",
+ "compile": "rollup -c ./rollup.config.js",
+ "watch": "npm run clean && npm run compile -- --watch"
+ },
+ "dependencies": {
+ "@reduxjs/toolkit": "^1.8.3",
+ "lit": "^2.2.8",
+ "pwa-helpers": "^0.9.1",
+ "todomvc-app-css": "^2.4.2",
+ "todomvc-common": "^1.0.5"
+ },
+ "devDependencies": {
+ "@rollup/plugin-node-resolve": "^13.3.0",
+ "@rollup/plugin-replace": "^4.0.0",
+ "rollup": "^2.77.2"
+ }
+}
diff --git a/examples/lit/rollup.config.js b/examples/lit/rollup.config.js
new file mode 100644
index 0000000000..5c2f36ccab
--- /dev/null
+++ b/examples/lit/rollup.config.js
@@ -0,0 +1,22 @@
+import replace from '@rollup/plugin-replace'
+import resolve from '@rollup/plugin-node-resolve'
+
+const extensions = ['.js']
+
+export default {
+ input: 'js/index.js',
+ output: [{
+ file: './out/index.js',
+ format: 'es',
+ sourcemap: true,
+ }],
+ plugins: [
+ replace({
+ preventAssignment: true,
+ values: {
+ 'process.env.NODE_ENV': `"${process.env.NODE_ENV}"`
+ }
+ }),
+ resolve({ extensions })
+ ]
+}
diff --git a/index.html b/index.html
index 9bff343ea4..91681bf986 100644
--- a/index.html
+++ b/index.html
@@ -117,6 +117,9 @@ Examples
Marionette.js
+
+ Lit
+
diff --git a/learn.json b/learn.json
index aa64509afe..075de5fa30 100644
--- a/learn.json
+++ b/learn.json
@@ -1150,6 +1150,46 @@
}]
}]
},
+ "lit": {
+ "name": "Lit",
+ "description": "Every Lit component is a native web component, with the superpower of interoperability.",
+ "homepage": "lit.dev",
+ "examples": [{
+ "name": "Example",
+ "url": "examples/lit"
+ }],
+ "link_groups": [{
+ "heading": "Official Resources",
+ "links": [{
+ "name": "Documentation",
+ "url": "https://lit.dev/docs/"
+ }, {
+ "name": "Tutorials",
+ "url": "https://lit.dev/tutorials/"
+ }, {
+ "name": "Live examples",
+ "url": "https://lit.dev/playground/"
+ }, {
+ "name": "Lit Blog",
+ "url": "https://lit.dev/blog/"
+ }]
+ }, {
+ "heading": "Community",
+ "links": [{
+ "name": "Lit Slack Workspace",
+ "url": "https://lit.dev/slack-invite/"
+ }, {
+ "name": "Twitter",
+ "url": "https://twitter.com/buildWithLit"
+ }, {
+ "name": "GitHub",
+ "url": "https://github.com/lit/lit/"
+ }, {
+ "name": "Stack Overflow",
+ "url": "https://stackoverflow.com/questions/tagged/lit+or+lit-html+or+lit-element"
+ }]
+ }]
+ },
"marionettejs": {
"name": "Backbone.Marionette",
"description": "Marionette simplifies your Backbone application code with robust views and architecture solutions.",