Skip to content

Commit

Permalink
Merge branch 'main' of github.com:paranext/paranext-core into fix-tai…
Browse files Browse the repository at this point in the history
…lwind-pattern-warning
  • Loading branch information
Jolie Rabideau authored and Jolie Rabideau committed Dec 2, 2024
2 parents 480b992 + aa56476 commit 4c9a812
Show file tree
Hide file tree
Showing 15 changed files with 3,801 additions and 2,327 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
ICheckRunner,
SettableCheckDetails,
} from 'platform-scripture';
import { VerseRef } from '@sillsdev/scripture';
import { Canon, ScrVers, VerseRef } from '@sillsdev/scripture';
import { CHECK_RUNNER_NETWORK_OBJECT_TYPE } from './check.model';
import {
aggregateProjectIdsByCheckId,
Expand Down Expand Up @@ -131,6 +131,32 @@ class CheckAggregatorDataProviderEngine
): Promise<DataProviderUpdateInstructions<CheckAggregatorDataTypes>> {
if (!subscriptionId) return false;

// Fix problems when range objects are VerseRefs but not working as expected
ranges.forEach((range) => {
if (!(range.start instanceof VerseRef)) {
// TS says range.start is of type "never", but treat it as a VerseRef with the wrong prototype
// eslint-disable-next-line no-type-assertion/no-type-assertion
const start = range.start as VerseRef;
range.start = new VerseRef(
Canon.bookIdToNumber(start.book),
start.chapterNum,
start.verseNum,
start.versificationStr ? new ScrVers(start.versificationStr) : undefined,
);
}
if (range.end && !(range.end instanceof VerseRef)) {
// TS says range.end is of type "never", but treat it as a VerseRef with the wrong prototype
// eslint-disable-next-line no-type-assertion/no-type-assertion
const end = range.end as VerseRef;
range.end = new VerseRef(
Canon.bookIdToNumber(end.book),
end.chapterNum,
end.verseNum,
end.versificationStr ? new ScrVers(end.versificationStr) : undefined,
);
}
});

// Update the subscription
this.findSubscription(subscriptionId).ranges = ranges;

Expand Down
168 changes: 86 additions & 82 deletions lib/platform-bible-react/dist/index.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/platform-bible-react/dist/index.cjs.map

Large diffs are not rendered by default.

168 changes: 86 additions & 82 deletions lib/platform-bible-react/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/platform-bible-react/dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/platform-bible-react/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;

--secondary: 210 40% 96.1%;
--secondary: 210 40% 90%;
--secondary-foreground: 222.2 47.4% 11.2%;

--muted: 210 40% 96.1%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { HasDirection } from '@/preview/preview-components/direction-toggle.comp
import WindowOrTabExample from './layouts/window.layout.component';
import Dashboard5Examples from './layouts/dashboard5.layout.component';
import ToolbarExamples from './layouts/toolbar.layout.component';
import DialogExamples from './layouts/dialog.layout.component';

function Layouts({ direction }: HasDirection) {
return (
Expand All @@ -19,11 +20,12 @@ function Layouts({ direction }: HasDirection) {
<VerticalTabsTrigger value="Toolbar">MUI Toolbar</VerticalTabsTrigger>
<VerticalTabsTrigger value="Settings">Settings (n/a)</VerticalTabsTrigger>
<VerticalTabsTrigger value="Shadcn Dashboard 5">Shadcn Dashboard 5</VerticalTabsTrigger>
<VerticalTabsTrigger value="Dialog">Dialog</VerticalTabsTrigger>
</VerticalTabsList>

<VerticalTabsContent value="Window">
<div className="tw-mb-2 tw-flex tw-gap-2">
<WindowOrTabExample direction={direction} />
<WindowOrTabExample direction={direction} isFocused />
<WindowOrTabExample direction={direction} />
</div>
<WindowOrTabExample direction={direction} />
Expand All @@ -40,6 +42,10 @@ function Layouts({ direction }: HasDirection) {
<Dashboard5Examples direction={direction} />
</div>
</VerticalTabsContent>

<VerticalTabsContent value="Dialog">
<DialogExamples />
</VerticalTabsContent>
</VerticalTabs>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Button } from '@/components/shadcn-ui/button';
import {
Card,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from '@/components/shadcn-ui/card';

export default function DialogExamples() {
return (
<>
<Card className="tw-w-[350px]">
<CardHeader>
<CardTitle>Confirm</CardTitle>
<CardDescription>Are you really sure</CardDescription>
</CardHeader>
<CardFooter className="tw-flex tw-justify-between">
<Button variant="outline">Cancel</Button>
<Button>Save</Button>
</CardFooter>
</Card>

<div className="tw-h-4" />

<div className="tw-w-[350px] tw-rounded-md tw-border tw-p-4">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit</p>
<div className="tw-flex tw-gap-2 tw-pt-4">
<Button variant="secondary">Proceed with unsaved changes</Button>
<Button>Save</Button>
</div>
</div>
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ import { HasDirection } from '@/preview/preview-components/direction-toggle.comp
import { defaultScrRef } from 'platform-bible-utils';
import { useState } from 'react';

export default function WindowOrTabExample({ direction }: HasDirection) {
export type HasIsFocused = {
isFocused?: boolean;
};

export default function WindowOrTabExample({ direction, isFocused }: HasDirection & HasIsFocused) {
const [scrRef, setScrRef] = useState(defaultScrRef);
const highlightClassName = isFocused
? 'tw-bg-primary tw-text-primary-foreground'
: 'tw-bg-secondary tw-text-secondary-foreground';
return (
<div className="tw-rounded-md tw-border">
<div className="tw-flex tw-flex-row tw-rounded-se-md tw-bg-muted/50">
Expand Down Expand Up @@ -117,12 +124,13 @@ export default function WindowOrTabExample({ direction }: HasDirection) {
</p>
<br />
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
est laborum.
Lorem{' '}
<span className={highlightClassName}>ipsum dolor sit amet, consectetur adipiscing</span>{' '}
elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
deserunt mollit anim id est laborum.
</p>
<br />
<p>
Expand Down
9 changes: 5 additions & 4 deletions lib/platform-bible-utils/dist/index.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/platform-bible-utils/dist/index.cjs.map

Large diffs are not rendered by default.

Loading

0 comments on commit 4c9a812

Please sign in to comment.