Skip to content

Commit

Permalink
Merge pull request #601 from Neovici/feat/pion
Browse files Browse the repository at this point in the history
feat: update to pion
  • Loading branch information
megheaiulian authored Jan 11, 2024
2 parents bbd5f0d + 0d49d48 commit 1586502
Show file tree
Hide file tree
Showing 33 changed files with 867 additions and 1,016 deletions.
2 changes: 1 addition & 1 deletion cosmoz-omnitable-group-row.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { component } from 'haunted';
import { component } from '@pionjs/pion';
import { nothing } from 'lit-html';

const GroupRow = ({ column, item, selected, folded, group }) => {
Expand Down
2 changes: 1 addition & 1 deletion cosmoz-omnitable-header-row.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html, component } from 'haunted';
import { html, component } from '@pionjs/pion';
import { repeat } from 'lit-html/directives/repeat.js';
import './lib/cosmoz-omnitable-resize-nub';
import { render } from './lib/settings/cosmoz-omnitable-sort-group';
Expand Down
2 changes: 1 addition & 1 deletion cosmoz-omnitable-item-expand-line.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { component, html } from 'haunted';
import { component, html } from '@pionjs/pion';

const OmnitableItemExpandLine = ({ column }) => html`
<style>
Expand Down
2 changes: 1 addition & 1 deletion cosmoz-omnitable-item-expand.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable object-curly-newline */
import { component, useEffect } from 'haunted';
import { component, useEffect } from '@pionjs/pion';
import { html, nothing } from 'lit-html';
import './cosmoz-omnitable-item-expand-line';
import { notifyResize } from './lib/utils';
Expand Down
2 changes: 1 addition & 1 deletion cosmoz-omnitable-item-row.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { component, html } from 'haunted';
import { component, html } from '@pionjs/pion';
import { repeat } from 'lit-html/directives/repeat.js';

const
Expand Down
2 changes: 1 addition & 1 deletion cosmoz-omnitable.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { html } from 'lit-html';
import { guard } from 'lit-html/directives/guard.js';

import { useOmnitable } from './lib/use-omnitable';
import { component } from 'haunted';
import { component } from '@pionjs/pion';
import { renderHeader } from './lib/render-header';
import { renderFooter } from './lib/render-footer';
import { renderList } from './lib/render-list';
Expand Down
2 changes: 1 addition & 1 deletion demo/hash-param.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<demo-router id="appRouter" />
<script type="module">
import { html } from 'lit-html';
import { component } from 'haunted';
import { component } from '@pionjs/pion';
import { hashbang } from '@neovici/cosmoz-page-router';

const routes = [
Expand Down
2 changes: 1 addition & 1 deletion lib/compute-layout.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html } from 'haunted';
import { html } from '@pionjs/pion';
import { layout } from './layout';

const
Expand Down
2 changes: 1 addition & 1 deletion lib/cosmoz-omnitable-resize-nub.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, component } from 'haunted';
import { useEffect, component } from '@pionjs/pion';
import { nothing } from 'lit-html';

const
Expand Down
2 changes: 1 addition & 1 deletion lib/settings/cosmoz-omnitable-settings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html, component } from 'haunted';
import { html, component } from '@pionjs/pion';
import { _ } from '@neovici/cosmoz-i18next';
import { isEmpty } from '@neovici/cosmoz-utils/template';
import { defaultPlacement } from '@neovici/cosmoz-dropdown';
Expand Down
2 changes: 1 addition & 1 deletion lib/settings/cosmoz-omnitable-sort-group.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { html } from 'haunted';
import { html } from '@pionjs/pion';
import { ifDefined } from 'lit-html/directives/if-defined.js';
import { triangle } from '../icons';

Expand Down
2 changes: 1 addition & 1 deletion lib/settings/drivers/context.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createContext, useContext, useMemo } from 'haunted';
import { createContext, useContext, useMemo } from '@pionjs/pion';
import local from './local';

export const DriverContext = createContext(local),
Expand Down
2 changes: 1 addition & 1 deletion lib/settings/use-saved-settings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, useEffect, useState } from 'haunted';
import { useCallback, useEffect, useState } from '@pionjs/pion';
import { normalizeStore } from './normalize';
import { useDriver } from './drivers';

Expand Down
2 changes: 1 addition & 1 deletion lib/settings/use-settings-ui.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback } from 'haunted';
import { useCallback } from '@pionjs/pion';
import { useMeta } from '@neovici/cosmoz-utils/hooks/use-meta';

const parseIndex = (str) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/settings/use-settings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMemo, useState, useRef, useCallback } from 'haunted';
import { useMemo, useState, useRef, useCallback } from '@pionjs/pion';

import useSavedSettings from './use-saved-settings';
import normalize, { sgProps } from './normalize';
Expand Down
2 changes: 1 addition & 1 deletion lib/use-canvas-width.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from 'haunted';
import { useState } from '@pionjs/pion';
import { useTrackSize } from './use-track-size';

export const useCanvasWidth = host => {
Expand Down
2 changes: 1 addition & 1 deletion lib/use-dom-columns.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useLayoutEffect, useState } from 'haunted';
import { useEffect, useLayoutEffect, useState } from '@pionjs/pion';
import { memooize } from '@neovici/cosmoz-utils/memoize';

const columnSymbol = Symbol('column'),
Expand Down
2 changes: 1 addition & 1 deletion lib/use-fast-layout.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useLayoutEffect, useMemo } from 'haunted';
import { useLayoutEffect, useMemo } from '@pionjs/pion';
import { toCss } from './compute-layout';
import { useResizableColumns } from './use-resizable-columns';
import { useCanvasWidth } from './use-canvas-width';
Expand Down
2 changes: 1 addition & 1 deletion lib/use-hash-state.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, useState } from 'haunted';
import { useCallback, useState } from '@pionjs/pion';
import { navigate } from '@neovici/cosmoz-router';
import { identity, invoke } from '@neovici/cosmoz-utils/function';

Expand Down
2 changes: 1 addition & 1 deletion lib/use-header.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable max-lines-per-function */
import { useEffect, useMemo } from 'haunted';
import { useEffect, useMemo } from '@pionjs/pion';

export const useHeader = ({
host,
Expand Down
2 changes: 1 addition & 1 deletion lib/use-layout.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMemo } from 'haunted';
import { useMemo } from '@pionjs/pion';
import { computeLayout } from './compute-layout';

export const useLayout = ({ canvasWidth, groupOnColumn, config }) => useMemo(() => {
Expand Down
2 changes: 1 addition & 1 deletion lib/use-list.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable max-lines-per-function */
import { html, useCallback, useEffect, useMemo, useRef } from 'haunted';
import { html, useCallback, useEffect, useMemo, useRef } from '@pionjs/pion';
import { indexSymbol } from './utils';
import { isEmpty } from '@neovici/cosmoz-utils/template';
import { onItemChange as _onItemChange } from './utils-data';
Expand Down
2 changes: 1 addition & 1 deletion lib/use-omnitable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from 'haunted';
import { useState } from '@pionjs/pion';
import { useProcessedItems } from './use-processed-items';
import { useFastLayout } from './use-fast-layout';
import { useSettings } from './settings';
Expand Down
2 changes: 1 addition & 1 deletion lib/use-processed-items.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, useEffect, useMemo } from 'haunted';
import { useCallback, useEffect, useMemo } from '@pionjs/pion';
import { invoke } from '@neovici/cosmoz-utils/function';
import { genericSorter } from './generic-sorter';
import { columnSymbol } from './use-dom-columns';
Expand Down
2 changes: 1 addition & 1 deletion lib/use-public-interface.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable max-lines-per-function */
import { useImperativeApi } from '@neovici/cosmoz-utils/hooks/use-imperative-api';
import { useEffect, useMemo } from 'haunted';
import { useEffect, useMemo } from '@pionjs/pion';
import { useNotifyProperty } from '@neovici/cosmoz-utils/hooks/use-notify-property';

const mkNapi = (host) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/use-resizable-columns.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useRef } from 'haunted';
import { useEffect, useRef } from '@pionjs/pion';

export const useResizableColumns = ({
host,
Expand Down
20 changes: 10 additions & 10 deletions lib/use-sort-and-group-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
useContext,
useCallback,
useEffect,
} from 'haunted';
} from '@pionjs/pion';
import { useHashState } from './use-hash-state';

const parseBool = (bool) => [true, 'true', 1, 'yes', 'on'].includes(bool),
Expand All @@ -16,7 +16,7 @@ const parseBool = (bool) => [true, 'true', 1, 'yes', 'on'].includes(bool),
setter(value);
setSettings((s) => ({ ...s, [name]: value }));
},
[setter, name, setSettings]
[setter, name, setSettings],
);

// eslint-disable-next-line max-lines-per-function
Expand All @@ -25,7 +25,7 @@ export const useSortAndGroupOptions = (
hashParam,
settings,
setSettings,
resetRef
resetRef,
) => {
const [sortOn, setSortOn] = useHashState(settings.sortOn, hashParam, {
suffix: '-sortOn',
Expand All @@ -36,23 +36,23 @@ export const useSortAndGroupOptions = (
{
suffix: '-descending',
read: boolParam,
}
},
),
[groupOn, setGroupOn] = useHashState(settings.groupOn, hashParam, {
suffix: '-groupOn',
}),
[groupOnDescending, setGroupOnDescending] = useHashState(
settings.groupOnDescending,
hashParam,
{ suffix: '-groupOnDescending', read: boolParam }
{ suffix: '-groupOnDescending', read: boolParam },
),
sortOnColumn = useMemo(
() => columns.find((column) => column.name === sortOn),
[columns, sortOn]
[columns, sortOn],
),
groupOnColumn = useMemo(
() => columns.find((column) => column.name === groupOn),
[columns, groupOn]
[columns, groupOn],
),
sortAndGroup_ = {
groupOn,
Expand All @@ -61,7 +61,7 @@ export const useSortAndGroupOptions = (
setGroupOnDescending: useSettingsState(
setGroupOnDescending,
'groupOnDescending',
setSettings
setSettings,
),

sortOn,
Expand All @@ -70,7 +70,7 @@ export const useSortAndGroupOptions = (
setDescending: useSettingsState(
setDescending,
'descending',
setSettings
setSettings,
),

columns,
Expand Down Expand Up @@ -100,5 +100,5 @@ customElements.define(
'sort-and-group-consumer',
component(({ render }) => render(useContext(SortAndGroupContext)), {
useShadowDOM: false,
})
}),
);
2 changes: 1 addition & 1 deletion lib/use-track-size.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect } from 'haunted';
import { useEffect } from '@pionjs/pion';

export const useTrackSize = (host, setCanvasWidth) =>
useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion lib/use-tween-array.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, useEffect, useRef, useState } from 'haunted';
import { useCallback, useEffect, useRef, useState } from '@pionjs/pion';

export const isCloseEnough = (a = 0, b = 0) => Math.abs(a - b) < 0.1,
// eslint-disable-next-line max-lines-per-function
Expand Down
Loading

0 comments on commit 1586502

Please sign in to comment.